Ajax request other than Get and Post

Type setting in Ajax request is used to specify HTTP method that can be used to make remote calls. Many firewalls and application servers are configured to discard other kind of request except Get and Post.

If we want to use other HTTP methods, then we can make a POST request, but add the X-HTTP-Method-Override header; Setting it to the method we want to use, like this;

X-HTTP-Method-Override: PUT

This convention is widely supported by web application frameworks and is a common way of creating RESTful web applications.

You can learn more about this here;

https://en.wikipedia.org/wiki/Representational_state_transfer

See the “Setting Timeouts and Headers” section for detail of how to set a header on a jQuery Ajax request.

FavoriteLoadingAdd to favorites
Spread the love

Author: Shahzad Khan

Software developer / Architect