There are many Dependency Injection libraries for ASP.NET MVC or Web API. Ninject is one of them. Ninject is optimized for MVC but you can use it for Web API with a minor adjustment.
Sending/Receiving files in Web API and HttpClient is a little bit complicated than the normal ASP.NET counterparts.
In this post, I explain how to authenticate users in Web API. To make it work, you need to enable sessions. (Please refer to my previous post to look at how to enable sessions in Web API).
By default, Sessions are not supported in Web API. The one of the design principles of Web API is atomic. But in some cases, you want to access session data. Let’s find out how can you do that.
To send “POST” and “PUT” requests, you need to send content in a message body. This makes the request a little more complex than a “GET” request.
This post explains how to create a Web API client application using the “HttpClient” class.
This post shows how to create a simple view to see the result of Web API requests.
In most cases, you would like to return “HttpResponseMessage” object rather than primitive types or complex types from Web API. Let’s find out why.