Top "Asp.net-web-api" questions

ASP.

ASP.NET Web Api: The requested resource does not support http method 'GET'

I've got the following action on an ApiController: public string Something() { return "value"; } And I've configured my routes as follows: …

asp.net asp.net-web-api
Could not load file or assembly System.Net.Http, Version=4.0.0.0 with ASP.NET (MVC 4) Web API OData Prerelease

Problem After installing the Microsoft ASP.NET Web API OData package 5.0.0-rc1 prerelease I end up with the following exception: …

asp.net-mvc-4 asp.net-web-api odata assembly-resolution
How to return a file using Web API?

I am using ASP.NET Web API. I want to download a PDF with C# from the API (that the …

c# asp.net-web-api
GlobalConfiguration.Configure() not present after Web API 2 and .NET 4.5.1 migration

I recently started following this guide to migrate my project to .NET 4.5.1 and Web Api 2. The very first thing MS …

c# asp.net-web-api asp.net-mvc-5 asp.net-4.5
Adding Http Headers to HttpClient

All: I need to add http headers to the HttpClient before I send a request to a web service. How …

c# asp.net-web-api dotnet-httpclient
Specifying a custom DateTime format when serializing with Json.Net

I am developing an API to expose some data using ASP.NET Web API. In one of the API, the …

c# datetime asp.net-web-api json.net
prevent property from being serialized in web API

I'm using an MVC 4 web API and asp.net web forms 4.0 to build a rest API. It's working great: [HttpGet] …

c# asp.net asp.net-mvc asp.net-web-api
Why do we have to specify FromBody and FromUri?

Why are the FromBody and FromUri attributes needed in ASP.NET Web API`? What are the differences between using the …

asp.net-web-api
Throw HttpResponseException or return Request.CreateErrorResponse?

After reviewing an article Exception Handling in ASP.NET Web API I am a bit confused as to when to …

c# exception-handling asp.net-web-api http-status-codes
How to get base URL in Web API controller?

I know that I can use Url.Link() to get URL of a specific route, but how can I get …

url asp.net-web-api base-url asp.net-web-api2