richie
6 years agoCommunity Hero
json response is 'plain/text' type. Anyway to change type to 'application/json'?
Hey
A 3rd party's webservice response payload is a wellformed json fragment (wellformed json confirmed by doing a wellformed check in xmlspy),but the Content-Type header on response is 'plain/text' rather than 'application/json' meaning the payload in the response is represented as a single string of text in the response's Outline tab making creating assertions difficult.
Before now when i wanted to change the type of the response (say from xml to json), i'd add an Accept header (value = application/json) to the request.
However adding the Accept header to the request did NOT change the response's type from text to json.
Would anyone have any ideas how i could get the response to be treated as json in ReadyAPI!s Outline tab?
Could an event handler do this? i.e. not actually change the type of the response, but change how its represented in the Outline tab?
Cheers!
Rich
A 3rd party's webservice response payload is a wellformed json fragment (wellformed json confirmed by doing a wellformed check in xmlspy),but the Content-Type header on response is 'plain/text' rather than 'application/json' meaning the payload in the response is represented as a single string of text in the response's Outline tab making creating assertions difficult.
Before now when i wanted to change the type of the response (say from xml to json), i'd add an Accept header (value = application/json) to the request.
However adding the Accept header to the request did NOT change the response's type from text to json.
Would anyone have any ideas how i could get the response to be treated as json in ReadyAPI!s Outline tab?
Could an event handler do this? i.e. not actually change the type of the response, but change how its represented in the Outline tab?
Cheers!
Rich