Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
ATernovenko
Contributor III
Contributor III

tRestClient: POST method with HTTP body

Hi everyone!

I need to send POST request with body. I use tRESTClient and this component does not get request body.

 

I tested my query by Postman, and its works.

Detalis of my query

 

POST api http://fgv-t-sv-biprfx.fgv.ua/api/login

HTTP body {"email":"<email>", "password": "<password>"}

 0695b00000Wti4jAAB.png

Headers

0695b00000Wti4tAAB.png

Labels (4)
2 Replies
ATernovenko
Contributor III
Contributor III
Author

My TOS Job

consists of the following components

 

tFixeFlowInut - pass Email and password by inline content

 

tWriteJSONField - Convert email and password to JSON object into "string" variable

 

0695b00000Wti9jAAB.png 

 

there is my JSON

0695b00000WtiArAAJ.png

 

 

tMap - assign variable "string" to column "string

tRESTClient - POST method with head content -type application/json Accept application/json

 0695b00000WtiCiAAJ.pngadvanced settings

 0695b00000WtiCsAAJ.pngtLogRow - give data in tabular form

 

But at the output I get an error 422. The tRESTClient component accepts the "string" field as a payload, not as a request body

 

0695b00000WtiC4AAJ.pngAre there solutions to this problem?

Please write if you have any questions, I will do my best to answer

 

Anonymous
Not applicable

Hi

Use tXMLMap instead of twriteJsonField+tMap, or you can use tRest to write the http body directly.

 

Regards

Shong​