Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
dstreun
Partner - Contributor III
Partner - Contributor III

tRESTClient with POST method does not write body

I want to read data (several rows) from a database table, build json strings from each row (by using tWriteJSONField) and send them to a REST service by a POST request.

But the tRESTClient component used with a POST method does not write the body. Is this a bug?

Someone else recommends using the tREST component but this component does not accept an input (row).

What else can I do?

Labels (3)
1 Solution

Accepted Solutions
dstreun
Partner - Contributor III
Partner - Contributor III
Author

Solved! I overlooked that the body must be of type document (not: String!)

Furthermore you can use tXMLMap to create such a document and pass it to tRESTClient.

 

In tRESTClient you can select ContentType JSON (althought you passed an XML document!!!) and in the Advanced settings check "Drop JSON Request Root".

 

In tXMLMap you create 2 attributes: body (of type document) and string (of type String). For an attribute of type document automatically a sub-element named "root" for looping is created. With a right-click on this root-element you can create next-level sub-elements where-to you can map your input-attributes...

View solution in original post

1 Reply
dstreun
Partner - Contributor III
Partner - Contributor III
Author

Solved! I overlooked that the body must be of type document (not: String!)

Furthermore you can use tXMLMap to create such a document and pass it to tRESTClient.

 

In tRESTClient you can select ContentType JSON (althought you passed an XML document!!!) and in the Advanced settings check "Drop JSON Request Root".

 

In tXMLMap you create 2 attributes: body (of type document) and string (of type String). For an attribute of type document automatically a sub-element named "root" for looping is created. With a right-click on this root-element you can create next-level sub-elements where-to you can map your input-attributes...