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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

tRestResponse and JSON

Hi!
Is it possible to return JSON in tRestResponse component? Xml works okay with tXmlMap component. But if we try to use tWriteJSONField component before tRESTResponse it does not work.. the tWriteJsonField component works okay if we log the data with tLogRow component..
Labels (5)
5 Replies
Anonymous
Not applicable
Author

Hi
You need to link tWriteJSONField to a tXMLMap component to map the result of tWriteJSONFiled to the body of tRESTResponse before tRESTResponse. Please see my screenshots.
Best reegards
Shong
Anonymous
Not applicable
Author

Thanks for the answer Shong..
The answer is more simple than I Imagined.. You just have to use Accept: application/json as http header in http reguest and it works.. Use for example fiddler or curl in testing 0683p000009MACn.png No need to add json components to the job.. 0683p000009MACn.png
Anonymous
Not applicable
Author

Thanks for the answer Shong..
The answer is more simple than I Imagined.. You just have to use Accept: application/json as http header in http reguest and it works.. Use for example fiddler or curl in testing 0683p000009MACn.png No need to add json components to the job.. 0683p000009MACn.png

ah, yes, I thought why do you need to write a Json string with tWriteJsonFiled.
Best regards
Shong
Anonymous
Not applicable
Author

Hi

Is it possible to accept JSON in tRESTClient?I want to use  tWriteJSONField component before tRESTClient , but return 500 error. Since the request method of KPI is POST, the parameters are sent to tRESTClient component in JSON format to get the data.

Anonymous
Not applicable
Author

Hi Min
The tRestClient requires a document and you need to use a tXMLMap before tRestClient to build the document, if you can select 'Json' format in the Accept Type list, the component will pass the data in JSON format.

Regards
Shong