ASP.NET Web API request processing not quite the same as MVC

Web API is an awesome new capability for web services.  One tidbit that I’m putting here for people searching is that:

The request body can only be read once!  In MVC and HttpContext, the request is stored so that it can be parsed over and over.  In Web API, with an eye to performance, the Body is just a stream.  Once it has been read, a subsequent read will fail because you are at the end of the stream.

That means that when you plan your model binding, you can only use one complex object.  The rest need to be bound some other way, either via the querystring or URI.

Here is an article that explains this is much more detail:

http://blogs.msdn.com/b/jmstall/archive/2012/04/16/how-webapi-does-parameter-binding.aspx