Web.API as standalone without user interface

I want to use WebApi as a standalone data access application.

When I create a new MVC 4 project, it installs a bunch of crap that I am not interested in for this purpose.

I need to remove views, contents, scripts, etc.

or would you recommend WCF for this purpose?

In addition, different browsers return different data formats, such as Firefox returns XML, IE return json.

I want all of them to return JSON. With WCF, if json is configured, they all return JSON. how can i get webapi to return only json for all browsers?

any thoughts?

+4
source share
1 answer

You can create an empty project and just pull in nugets to get all the functionality of the web api.

To force JSON only, the easiest approach is to clear the collection of global formatters and then just add the JSON formatter.

+5
source

All Articles