0

In my web api I allow the user to specify how they want their data via an extension: ie. host/api/location/getmyhouse.json or getmyhouse.xml.

However I also have actions that aren't get and they return if the action was successful or not. For that it doesn't really make sense to specify the return type so I was trying to have it just default to json. However by default it seems xml is used.

Is there a way to default the formatter to json vs xml without removing xml as a formatter AND without having the client specify it as I want this to be done via simple url in the browser. It's an internal thing so that's what we would like.

user441521
  • 6,942
  • 23
  • 88
  • 160
  • Possible duplicate: http://stackoverflow.com/q/25224824/1260204 – Igor Nov 21 '16 at 21:05
  • Possibly but no answer was selected. I'll try a few and see if any work. – user441521 Nov 21 '16 at 22:16
  • Possible duplicate of [How do I get ASP.NET Web API to return JSON instead of XML using Chrome?](https://stackoverflow.com/questions/9847564/how-do-i-get-asp-net-web-api-to-return-json-instead-of-xml-using-chrome) – Igor Nov 29 '17 at 18:59

0 Answers0