Skip to main content
1-Visitor
Apr 15, 2019 7:36 AM UTC
Question

getJson returning header in output

I am making a get call using thingworx GETJson service. The service is returning headers in between json.

"Name":"CR 03"}],"headers":"","000001":. As headers is not any field in json format it is displaying in output. While hitting the same URL in google chrome it is showing the exact Json format without header field. Please suggest.

 

1 reply

15-Moonstone
Apr 16, 2019 1:13 PM UTC

Check what is the value of "Content-Type" of the response headers in both browser and from GetJSON.

If the browser response Content-Type is anything else than "application/json" like "text/plain" try setting same type in the headers on GetJSON or use GetText instead that uses Content-Type of "text/plain".

Translate