1future
1future

Reputation: 51

Returning Json objetcs in Chrome using ASp.Net Web Apis

I am fairly new to web API and i'm currently following this tutorial I have only got as far as task 3 and i'm quite learning a lot.

As you can see the tutorial is using Internet Explorer and I am using Chrome .. for some reason Chrome is returning xml and IE is returning a json object. Should I worry about this or not? i'd love it if Chrome returned a Json object though..

Thank you

Upvotes: 0

Views: 50

Answers (1)

Craig H
Craig H

Reputation: 2071

WebApi is pretty cool in that it will serialise it's output as JSON or XML based on the accept header sent by the browser.

I expect that Chrome's default is XML, and IE's is JSON.

I can't find a simple configuration change example for Chrome, with most information pointing to having to use a plugin to change the accept header. In Firefox the default is XML but you can adjust it with a config change.

Upvotes: 1

Related Questions