BackboneJS - Sync Backbone.emulateHTTP - Backbone.js

Description

If you are using a legacy web server that doesn't support Backbone's default REST/HTTP approach, you may choose to turn on the Backbone.emulateHTTP. Setting this option to true will fake PUT, PATCH and DELETE requests with a HTTP POST, setting the X-HTTPMethod-Override header with the true method.

If emulateJSON is also on, the true method will be passed as an additional _method parameter.

Syntax

Example

Output

Let us carry out the following steps to see how the above code works −

  • Save the above code in the backbone-emulatehttp.htm file.
  • Open this HTML file in a browser.

output

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Backbone.js Topics