I recall that I could before REST API response result as JSON. Currently it shows me it as xml. Is there any settings in Edge browser that would help me to get Json instead Xml?
I recall that I could before REST API response result as JSON. Currently it shows me it as xml. Is there any settings in Edge browser that would help me to get Json instead Xml?
When viewing a GET endpoint in a browser like Google Chrome, Firefox, or Microsoft Edge, the default Content-Type displayed in the browser is generally text/html in XML format. This is by design. I think what you should do is modify the code instead of trying to set the browser to solve it. You can use something like this :
Content-Type: "application/json"
I found a good discussion on this issue, you can refer to it: How do I get ASP.NET Web API to return JSON instead of XML using Chrome?
Content-Type is decided by the REST API, you can't change it in browser. If you want to see JSON, you need to change it in the REST API.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.
Regards,
Yu Zhou
I know how to develop in different languages. It wasn't the question. My question is simple. I want to see JSON when I use REST API in browser's url, not XML. Is it possible?
The HTTP response Content-Type header will be used to determine the content type and character encoding. When you do not set its content-type, the response result you get will default to text/html encoding and will be displayed in xml format. For more details, please refer to Http-Header-ContentType.
Content-Type is decided by the REST API, you can't change it in browser. If you want to see JSON, you need to change it in the REST API.
I've also edited my answer.
Following is the example of what I see. As you see this is a feed using XML. I want the same but JSON.

5 people are following this question.