I am sending a request to a webservice using tRestClient. The data is formatted in Json first before sending it to the webservice. The job fails with BadRequestException. I tried the request using a standard Rest client to ensure that the webservice is working fine. I think it is some setting in the Trestclient that is causing problem. I have attached a zip file with the job. The request that I need to send to the service is below: POST /api/users HTTP/1.1 Host: localhost:8081 Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ1c2VyIjoiNTVmMWQxOGU3OTYwMmUyZGQxZThjZDhlIiwiYXBpU2VjcmV0IjoiMWI0YWMyNWQtOTQyOS1jZGE5LWZmY2YtYmRmMjljZDNlMTlmIiwiaWF0IjoxNDU3MzY5NTg2fQ.ffcp1Ih2sD0i2HjU8EoX1bzd7-tfC0U6kQ9wsvOXOLc Content-Type: application/json Cache-Control: no-cache Postman-Token: 7833994a-5c06-cb7d-2aae-7135e1fe5744
Here is what the log shows:
ID: 1
Address: http://localhost:8081/api/users
Http-Method: POST
Content-Type: application/json
Headers: {Content-Type=, Accept=, Authorization=}
It passes the header information successfully. However I do not see the payload being sent to the webservice. The webservice returned this error message:
Payload: {"status":"error","message":"wrong json format - must br as array"}
This is how I have linked the objects:
tfileinputdelimited->twritejsonfield->trestclient->tlog.
In the Input Schema of the trestclient, I have mapped the output from twritejsonfield to one column output.
Is this how a payload is passed from a previous component to trestclient?