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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Guest UserRank #816 · 2.8K reputationPosted May 30, 2017, 5:27 AM EDT
Fabricio Fogaça21 reputationPosted May 30, 2017, 5:50 AM EDT
Saravanan VRank #1,695 · 899 reputationPosted May 30, 2017, 7:25 AM EDT
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 RRank #404 · 6.2K reputationPosted May 30, 2017, 5:59 AM EDT