ASP.NET Web API and HttpClient Available on NuGet

If you don’t need the full ASP.NET MVC 4 installer with project and item templates for Visual Studio 2010 then you can download the various ASP.NET Web API packages directly from NuGet (see list of packages below). If you are new to NuGet then it is a Visual Studio extension that makes it easy to add, remove, and update libraries and tools in Visual Studio projects that use the .NET Framework (check out the NuGet overview).

NuGet Packages

Here are the relevant NuGet packages depending on what you want to build:

  1. Web API hosted in ASP.NET: AspNetWebApi
  2. Self-hosted Web API: AspNetWebApi.Selfhost
  3. HttpClient including XML and JSON formatters: System.Net.Http.Formatting
  4. JsonValue for navigating and manipulating JSON: System.Json

Additional Information

  1. Release notes for installation instructions and to find out what’s new.
  2. ASP.NET Web API home complete with docs, samples, tutorials and videos.

Have fun!

Henrik Tags: ,,,,
Comments (13)
  1. Hello. Is "ASP.NET Web API" open source?What's the difference "ASP.NET Web API" and "WCF Web API"?

  2. Jamie says:

    If you check the codeplex project for WCF web API there is an announcement.

  3. John says:

    I tried to install AspNetWebApi using Nuget, and make a simple controller in an existing MVC 3 app. It would complain that System.Json was not found.

    Is there a dependency on System.Json for AspNetWebApi? Manually doing Install-package System.Json solved the problem

  4. John, yes we forgot to add System.Json as a package dependency. Manually adding it works.

  5. Eric Falsken says:

    I can't find the EnableTestClient and EnableHelpPage settings. Where'd they go? And the spiffy MapServiceRoute<T> method is gone too? How do I host WebAPI services in a classic ASP.NET WebForms application?

  6. I would love to see System.Json being ported to .net 3.5 sp1 client profile. Would be even better if it could go down to .net 2.0.

    For platforms that doesn't support dynamic we could continue to use IDictionary<string,object> as JsonObject and IList<object> as JsonArray.

    This would really be helpful for those creating libraries such as Facebook/Twitter targeting multiple platforms sl4/wp7/winrt/.net3.5/.net4.0.

  7. Ivan Padron says:

    Is there any plans to release an HttpClient library for Silverlight?  Idea when is gonna be available?

    BTW the ASP.NET Web API rocks.

  8. Eric, help page and test client didn't make it into beta but we are looking at it now.

  9. Coredump03 says:

    I am trying to get my form to work but it will not sent out the email here is my line of code:

    <div method="post" action="">

  10. Jonathan says:

    Is there a way to pass a complex type (ArrayList, etc) as a parameter to the Web API?  I am wanting to create an API that can be called from both Web and WinForms.  Not sure how to pass an ArrayList as a parameter from WinForms.

  11. John says:

    how do I use xml string in post method?. I can't map it to a class since the format is unknown. webapi fails with mediaformat error.

  12. You can use StringContent and then set the media type explicitly to "application/xml".

  13. John says:

    I couldn't get StringContent working in post method. I tried removing the json formatter and adding a new media formatter with application/xml. I am getting various errors depending on what I pass in accept and content-type.

Comments are closed.

Skip to main content