Category Archives: REST

Creating API Help Pages

InstallĀ ASP.NET and Web Tools 2012.2 Update. This update integrates help pages into the Web API project template.

Next, create a new ASP.NET MVC 4 project and select the Web API project template. The project template creates an example API controller namedĀ ValuesController. The template also creates the API help pages. All of the code files for the help page are placed in the Areas folder of the project.

Continue reading Creating API Help Pages

Difference between POST and PUT

I was asked a question today about what was the difference between POST and PUT when referring to HTTP.

There seems to be some confusion over what people understand it to be; it is quite simple, just to avoid any confusion here is the RFC itself explains the core difference:

The fundamental difference between the POST and PUT requests is reflected in the different meaning of the Request-URI. The URI in a POST request identifies the resource that will handle the enclosed entity. That resource might be a data-accepting process, a gateway to some other protocol, or a separate entity that accepts annotations. In contrast, the URI in a PUT request identifies the entity enclosed with the request — the user agent knows what URI is intended and the server MUST NOT attempt to apply the request to some other resource. If the server desires that the request be applied to a different URI, it MUST send a 301 (Moved Permanently) response; the user agent MAY then make its own decision regarding whether or not to redirect the request.