cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

getJson returning header in output

isha
7-Bedrock

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 1
MarekP.Nowaczyk
15-Moonstone
(To:isha)

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".

Announcements


Top Tags