I need detailed understanding of WEB API in ASP.NetMVC. Can smeone help me?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Saravanan VPosted May 30, 2017, 11:25 AM
I have explained below the What, Why, How and Where part of Web API.
What:
Web API's controller action only return data that is serialized and sent to the client.ASP.NET Web API is a framework that makes it easy to build HTTP services that reach a broad range of clients, including browsers and mobile devices. ASP.NET Web API is an ideal platform for building RESTful applications on the .NET Framework.
Why:
To expose your data to all of the modern devices from your rich internet applications. Typically, these applications use their HTTP connection to return data in the form of JSON or XML rather than HTML markup.
Content Negotiation based on Accept headers for request and response serialization.
[HttpGet]
public HttpResponseMessage ValidateProduct(int productId)
{
}
You can call your Web API method from client-side as below,
$.ajax({
}
});
You could use Web API in your ASP.NET Web Forms or MVC Applications or Single Page Applications.
Hosting:
It can be hosted with in the application or on IIS.
Thiruppathi RPosted May 30, 2017, 9:59 AM
Fabricio FogaçaPosted May 30, 2017, 9:50 AM
Guest UserPosted May 30, 2017, 9:27 AM