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