Skip to content

Web API

txgz999 edited this page Jun 2, 2020 · 8 revisions

We discuss ASP.NET Web API, mainly in the context of serving as service to Angular client.

Content Type

When we return a .Net object or collection of objects in a method of ApiController, Web API would automatically serialize the object and return the content in either xml format or json format, depends the Accept value in the request header. When the Angular HttpClient object sends a request, by default, it’s Accept header contains application/json, thus the response would be in json format.

Clone this wiki locally