Skip to content

Using different HTTP Methods when mapping controllers

Mat Ryer edited this page Oct 16, 2013 · 2 revisions

To use different HTTP methods when mapping controllers, you can overwrite the goweb.DefaultHttpHandler().HttpMethodFor* variables.

For example, to use POST for a deletes instead of DELETE, you could do this:

goweb.DefaultHttpHandler().HttpMethodForDeleteOne = gowebhttp.MethodPost
goweb.DefaultHttpHandler().HttpMethodForDeleteMany = gowebhttp.MethodPost

When you then use MapController, the HttpMethodFor* strings will be used for the HTTP methods, instead of the hard-coded built in ones.