Forum Discussion
richie
4 years agoCommunity Hero
Hey eissaeva,
Can you confirm the Content-Type header of the response please?
This will indicate the supported datatype of the response.
Ta
Rich
Can you confirm the Content-Type header of the response please?
This will indicate the supported datatype of the response.
Ta
Rich
- eissaeva4 years agoContributor
The content type of the response header is text/plain
- richie4 years agoCommunity HeroHey eissaeva,
Yep...."text/plain" Content-Type header value results in the payload being ignored by ReadyAPI's/SoapUI's json or xml parsers, which makes asserting on thr content awkward.
If youre expecting the response to be wellformed Json or xml this sounds like a sloppy defect for dev to fix.
However, depending on the app server endpoint youre hitting you can alter the datatype of the response by doing the following:
Add an Accept HTTP header to the request which generates the json response thats comimg back with the text/plain Content-Type header. Ensure the value of the Accept header is either text/json or application/json (try both, one or even both might not work....depends on what your endpoint supports) Resubmit the request, view and check the results. Whats the Content-Type of the response? Do you now get content in the json response tab?
This has worked numerous times for me when i had the same problem. It very rarely didnt work due to a restriction on the endpoint.
Cheers
Rich- eissaeva4 years agoContributor
tried with both - the value of the Accept header is either text/json or application/json - did not work
Related Content
- 5 years ago
- 2 years ago
- 8 years ago
- 4 years ago
Recent Discussions
- 15 days ago
- 22 days ago