There are times when you might want to serve binary files from your controller’s action method in ASP.NET MVC Web API. You can do this easily by setting the octet-stream content for the HttpResponseMessage as shown in the code snippet. How to return Binary File from a Action Method in ASP.NET Web API ?
When you make a call to the ASP.NET Web API action method and notice this in Google Chrome browser , you would see that by default the data would be displayed in the XML format as shown in the screenshot. How to return Json instead of XML in ASP.NET Web API ? You can easily […]
There are times when you might want to add Web API project to one of your existing ASP.NET MVC project instead of creating a new one. How to Add Web API to existing ASP.NET MVC Project ? You can easily do that by installing it from NuGet. Simply open the Package Console Manager and run […]
This blog post will explain on how to create a Simple ASP.NET Web API using Microsoft Visual Studio 2015 and return an expose a List (Eg: List<Students>) over HTTP. This includes creating action methods and using them for get all students and get a particular student by id. How to create a Web API in […]