Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in NYC Sept 4th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Labels (4)
5 Replies
Anonymous
Not applicable
Author

not able to upload the zip file or screenshot. 
Anonymous
Not applicable
Author

is there a minimum no of posts that I should have before I can upload zip files?
Anonymous
Not applicable
Author

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.
Anonymous
Not applicable
Author

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?
Anonymous
Not applicable
Author

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

0683p000009MDQt.png