Forum Discussion
eissaeva
Contributor
Also, my response is in JSON format
Is it possible to convert it to XML?
richie
4 years agoCommunity Hero
Hey eissaeva
Easiest way to convert json to xml in a response is to add the 'Accept' http header to the request that generates the response.
The value you set for the header will be 'application/xml'.
This will set the response sent back from your endpoint as xml
Cheers
Rich
Easiest way to convert json to xml in a response is to add the 'Accept' http header to the request that generates the response.
The value you set for the header will be 'application/xml'.
This will set the response sent back from your endpoint as xml
Cheers
Rich
- eissaeva4 years agoContributor
Thank you for this input, Rich
From the previous answer you provided "The 'Response' bit just means the response of the specified request."
'Response' - is just a string, not a variable holding the response, correct?
- nmrao4 years agoChampion Level 3eissaeva, 'Response' is property name that readyapi internally defines and assign value on receipt of response.
- eissaeva4 years agoContributor
Changed response header to accept application/xml in both requests and followed the instructions but this did not work
Attaching screenshot of the error and my code sample
Related Content
- 2 years ago
- 9 years ago