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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

[resolved] How to pass POST data to tRESTRequest Component properly

I've followed the tutorial on creating RESTful Web Services from: http://talendforge.org/tutorials/tutorial.php?language=english&idTuto=104
But the tutorial is a bit lacking on creating a POST REST Web Service.
I've played around it a bit but I'm not sure why the payload passed to the tRESTRequest doesn't propagate properly.
I ticked the "Log messages" option in tRESTRequest so I saw that the payload is received by the tRESTRequest component. But after the tXMLMap, the value of the payload is already null.
I'm attaching an image of the job components, including the component view of the tRESTRequest and tXMLMap, the rest client which I used to send the post request, and the logs of the result.
Thanks in advance.
0683p000009MCyZ.png 0683p000009MCya.png 0683p000009MCzl.png
Labels (4)
1 Solution

Accepted Solutions
Anonymous
Not applicable
Author

Hi, to get the XML body mapped you need to add a 'body' parameter of type Document; you only need to qualify the parameters, such as queries, headers, URI path values; this is also done for form payloads as in your case, or for multipart payloads
HTH, Sergey

View solution in original post

11 Replies
Anonymous
Not applicable
Author

Hi
You have a form payload, so you can either
- add a 'body' parameter of type String and then parse it manually or
- add parameters with the names matching those in the form payload and 'qualify' then by updating 'Comments' with the value 'form', no quotes
HTH, Sergey
Anonymous
Not applicable
Author

Sorry, did not see all of your images; just update Comments and it should work
Anonymous
Not applicable
Author

Hi sberyozkin, Thank you for your reply. Where could I see the "Comments" section? Under the Documentation tab? Can you refer me a guide or a tutorial on how to do it? Thanks in advance.
I'm using Talend Open Studio for ESB 5.4.1 if that would help.
Anonymous
Not applicable
Author

Thanks sberyozkin, that tip on "qualifying" parameters worked when I was passing form data. How did you know about that? Is there a documentation on those tips? 0683p000009MACn.png
Thank you very much! What I'm working on right now is passing an XML post data, is there also some things that I need to do to "qualify" the post data? Thanks in advance.
Anonymous
Not applicable
Author

Hi, to get the XML body mapped you need to add a 'body' parameter of type Document; you only need to qualify the parameters, such as queries, headers, URI path values; this is also done for form payloads as in your case, or for multipart payloads
HTH, Sergey
Anonymous
Not applicable
Author

Thank you very much Sergey! That clears some things up. Hope this also help other users. 0683p000009MACn.png
Regards,
Maki
_AnonymousUser
Specialist III
Specialist III

Thanks for this post ! it solved my problem. And Maki is right, how could you find that !?!?! Crazy to put some logic on a comment field !
But not complaining! everything works well ! Great product!
Anonymous
Not applicable
Author

Cool.
You are right that using a comment filed is not exactly type safe :-). But we had to use the available tooling-level fields at a time of designing tRESTRequest.
We have some ideas on how to make it all much more wizard- and user- friendly and hopefully at some point in the future it will be realized...
Sergey
Anonymous
Not applicable
Author

Wow

this is really crazy. It took me one hour to really understand what is going on here. After 3 years, this is still the solution.