Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for X-HTTP-Method-Override header on REST requests #814

Merged

Conversation

hprange
Copy link
Contributor

@hprange hprange commented Jan 31, 2017

Sometimes a client cannot consume REST services using methods like PUT, DELETE or PATCH, due to browser limitation or firewall rules. Some frameworks provide a workaround using the X-HTTP-Method-Override header to override the method of a request. No change to the route configuration is necessary. The client of the API just informs the override header, and the ERRest library maps routes as expected. Keeping a RESTful API on the server side is the main benefit of that approach. No need for alternate / unRESTfull routes creation.

Scott Hanselman talked in more detail about that in a blog post.

Sometimes a client cannot consume REST services using methods like PUT, DELETE or PATCH, due to browser limitation or firewall rules. Some frameworks provide a workaround using the X-HTTP-Method-Override header to override the method of a request. No change to the route configuration is necessary. The client of the API just informs the override header, and the ERRest library maps routes as expected. Keeping a RESTful API on the server side is the main benefit of that approach. No need for alternate / unRESTfull routes creation.

Scott Hanselman talked in more detail about that in [a blog post](http://www.hanselman.com/blog/HTTPPUTOrDELETENotAllowedUseXHTTPMethodOverrideForYourRESTServiceWithASPNETWebAPI.aspx).
@hprange
Copy link
Contributor Author

hprange commented Jan 31, 2017

Hey guys, I'm not sure where is the best place to document this feature. Should I do that in the WOCommunity wiki?

@darkv
Copy link
Member

darkv commented Feb 4, 2017

Hi Henrique, the WOCommunity wiki should be good for that kind of information.

@darkv darkv merged commit 835e3cf into wocommunity:master Feb 4, 2017
@hprange hprange deleted the httpMethodOverrideHeaderSupportForERRest branch November 1, 2017 13:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants