tRestClient returns BadRequestException

One Star

tRestClient returns BadRequestException

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
One Star

Re: tRestClient returns BadRequestException

not able to upload the zip file or screenshot. 
One Star

Re: tRestClient returns BadRequestException

is there a minimum no of posts that I should have before I can upload zip files?
One Star

Re: tRestClient returns BadRequestException

If someone can help with this, I can email you the zip file along with the csv file so you can run the job and see. Let me know pl.
One Star

Re: tRestClient returns BadRequestException

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?
Moderator

Re: tRestClient returns BadRequestException

Hi,
So far, no limitation exists for the image.(10 posts for posting URL)
You are able to upload images for the first topic/post.
Best regards
Sabrina

--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.

Cloud Free Trial

Try Talend Cloud free for 30 days.

Tutorial

Introduction to Talend Open Studio for Data Integration.

Definitive Guide to Data Integration

Practical steps to developing your data integration strategy.

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.