PROGRAM AREA
WebApi Top questions
Post
New Post
Find by name:
WebApi
First Name
PostDate
What is the content negotiation in Web API?
Content negotiation is the process of selecting the best representation for a given response when there are multiple representations available. Means, depending on the Accept header value in the request, the server sends the response. The primary mechanism for content negotiation in HTTP are these request headers − Accept − Which media types are acceptable for the response, such as "application/json," "application/xml," or a custom media type such as "application/vnd.example+xml" Accept-Charset − Which character sets are acceptable, such as UTF-8 or ISO 8859-1. Accept-Encoding − Which content encodings are acceptable, such as gzip. Accept-Language − The preferred natural language, such as "en-us". The server can also look at other portions of the HTTP request. For example, if the request contains an X-Requested-With header, indicating an AJAX request, the server might default to JSON if there is no Accept header.
What is Web API Routing?
All routes are registered in Route Tables. For example: Routes.MapHttpRoute( Name: "ExampleWebAPIRoute", routeTemplate: “api/{controller}/{id} defaults: new { id = RouteParameter.Optional}
What is Web API?
Web API is a framework which is used to build/develop HTTP services.
Page 11 of 12
««
«
…
3
4
5
6
7
8
9
10
11
12
»
Full Page