Bare Minimum Part 1 of this series showed how to add a read only web service to an ASP.Net MVC web site with one line of code. In this post we’ll add a second line of code to give us a web service that can receive data.

Receiving Multiple Representations

Just as we want to be able to serve multiple representations of the same resource, we would also like to receive multiple representations. To add this capability to your web service you can use a Custom Model Binder that comes as part of the ROM assembly. There are two options for introducing the MultipleRepresentationsBinder:

Use the [MultipleRepresentationsBinder] attribute on any action parameters that should be bound to the request body e.g.: