expressjs support for method delete and put without the methodoverride

How do i get expressjs to use the delete and put methods for form?

<form method="DELETE" action="">

Using the above is sending a GET request in latest stable version of chrome. Is this supposed to be a browser issue?

Is there a better way to override this without having a special input field for supporting these?

You just need to set the form to post, then create a hidden field like

<input type="hidden" name="_method" value="delete"/>

And set the configuration, according to the express version you are using. Then the form method will be overridden by the value of that hidden field.

The latest version of will require you to install the method-override package, then configure your app like this:

var methodOverride = require('method-override')
app.use(methodOverride('_method'));

Old versions might use:

app.use(bodyParser.json());
app.use(bodyParser.urlencoded());
app.use(express.methodOverride());

An even older usage was:

app.use(express.bodyParser());
app.use(express.methodOverride());

actually express.bodyParser() is deprecated in versions 3.4 of Express and 2.9 of Connect. There is security issues on the use of express.bodyParser() explained here