Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
Here is my job :
I want to send a post request with a json body. I'm getting the json from a raw file. Here is my tMap :
I saw that for a json it was the string field of the trestclient that was used.
But i don't understand, i still get nothing in the output body of tRestClient.
If you need more information, just ask, i'll do my best to answer.
Thank you.
Use tRest to include a POST body. You can just pass the row object into that body text field and it will pass it through.
Use tRest to include a POST body. You can just pass the row object into that body text field and it will pass it through.
Thank you it's way more simple indeed.
Unfortunately, i still have an empty body response.
Here is my request body :
{
"request": "1",
"io_mode": "json",
"do_in": [
"{\"method\":\"Infos.getInfos\"",
"\"params\":[]}"
]
}
He's the syntax good ? It's maybe because of that.
Have you made this request successfully in something other than Talend (e.g. Postman)? I usually try it there first to see of my syntax is correct. Also, wouldn't hurt escaping all your double quotes.
In JSON it was not working so i tried another format :
request=1&io_mode=json&do_in={"method":"Infos.getInfos","params":[]}
I wrote this in my tRest :
"request=1&io_mode=json&do_in={\"method\":\"Infos.getInfos\",\"params\":[]}"
As you can see i escaped all my double quotes.
But it's still not working.
It's ok. I just forgot to change the content-type. I close the topic.
I know this was resolved but i am just adding for when someone has issues with this again. If you have your JSON already in a file then this is for you, but if you don't i suggest this post --> https://community.talend.com/s/feed/0D73p000004sQALCA2 (for tRestClient).
How:
If everything is good it should work.
Hope this helps someone.
Vader Out 💪.