The content you are trying to view cannot be viewed as JSON
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2021
09:19 AM
07-16-2021
09:19 AM
The content you are trying to view cannot be viewed as JSON
Hi
I am not able to view response in JSON
ReadyAPI 3.8.0
The tool shows views for all other formats successfully
Solved! Go to Solution.
Labels:
- Labels:
-
REST
5 REPLIES 5
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-17-2021
01:19 PM
07-17-2021
01:19 PM
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
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2021
08:11 AM
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2021
09:23 AM
07-19-2021
09:23 AM
Hey @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
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
if this helped answer the post, could you please mark it as 'solved'? Also if you consider whether the title of your post is relevant? Perhaps if the post is solved, it might make sense to update the Subject header field of the post to something more descriptive? This will help people when searching for problems. Ta
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2021
11:56 AM
07-26-2021
11:56 AM
tried with both - the value of the Accept header is either text/json or application/json - did not work
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2021
08:09 PM
07-26-2021
08:09 PM
You need to report to your team and get it addressed if the services are developed by your team.
Regards,
Rao.
Regards,
Rao.
