Web API Preview 5 Is Now Available

New Features/Enhancements

  • OData Formatter
  • Dependency refactoring from host common code
  • Support for Batch with mime/mixed content where every part has a full HTTP request
  • Web API code-based configuration (simplifications)
  • Web-based test client for WCF Web API
  • HTTP File upload
  • Refactored formatters
  • Better IoC support
  • Additional samples for specific features such as file upload
  • Content negotiation now supports qualifiers
  • ActionOfStreamContent - Enables accessing the raw content stream
  • New HttpMemoryBinding to enable in-memory hosting and invoking of Web APIs

New Prototype Features (on WebAPI-Prototype branch)

  • WebApiConfiguration includes conventions for WebGet/WebInvoke
  • WebApiRoute provides better side by side integration with MVC routes
  • MapServiceRoute extension method simplified registration and usage of WebApiConfiguration
  • SetDefaultHttpConfiguration / GetDefaultHttpConfiguration extension methods enable the getting and setting of a global configuration object that will be used by default by
  • MapServiceRoute unless a specific one is provided
  • MediaTypeFormatterCollectionExtensions.AddRange enables a more compact way to add formatters
  • FormUrlEncodingMediaTypeFormatter
  • Task<T> for Web API operations and sample

Breaking Changes

  • DelegatingChannel renamed to DelegatingHandler
  • HttpChannel renamed to HttpMessageHandler
  • FormUrlEncodingMediaTypeFormatter and JsonValueMediaTypeFormatter were moved from the default branch to the WebAPI-Prototype branch as they are not currently part of the core product source
  • DelegatingHandler no longer require passing in a channel in the constructor making it more friendly to inversion of control (IoC) containers
  • New constructor overload on HttpMessageHandlerFactory overload which accepts a Func<IEnumerable<DelegatingHandler>> to allow user code or IoC containers to construct handlers.
  • IQueryable previously supported case-insensitive matches on operators. In the current drop we only will match on lowercase operators i.e. "$top" but not "$Top". According to the spec this is correct behavior however we could relax it in the future.


Like I mentioned above, preview 5 is also being released on Nuget today. Here's the breakdown of the Nuget packages that will be available:

  • HttpClient : like it sounds, this gives you the HttpClient object model, which can be used by both the server and the client for a symmetric HTTP programming experience.
  • JsonValue : Contains JsonValue API for typeless / dynamic access to Json.
  • WebApi : The server-side object model for Web API
  • WebApi.All : Preserved for backwards compatibility; basically just pulls in everything.
  • WebApi.Core : Preserved for backwards compatibility; pulls in WebApi.0.5.0
  • WebApi.Enhancements : Gives you the Web API core product code plus the enhancements library (from the prototype branch)
  • WebApi.OData : Enables returning OData from a Web API.

In addition to the core Nuget packages, we're also pushing up a set of symbol packages so that you can more easily debug through Web API source code.

  • HttpClient.0.5.0.symbols.nupkg
  • JsonValue.0.5.0.symbols.nupkg
  • WebApi.0.5.0.symbols.nupkg
  • WebApi.Enhancements.0.5.0.symbols.nupkg
  • WebApi.OData.0.5.0.symbols.nupkg