RingoJS

Module middleware/method

JSGI middleware for HTTP method override.

Since older browsers are not able to send XMLHttpRequest with methods other than GET and POST, this middleware allows the method of POST requests to be overridden based on the value of a HTTP form parameter. The default name for the override parameter is _method. This can be configured through the method.key property.

Example

app.configure("method");
app.method.key = "__method";

Functions


middleware (next, app)

JSGI middleware for HTTP method override.

Parameters

Function next

the wrapped middleware chain

Object app

the Stick Application object

Returns

Function

a JSGI middleware function