Function warp_form_method::form_method[][src]

pub fn form_method(
    method: Method
) -> impl Filter<Extract = (), Error = Rejection> + Clone

Returns a Filter that matches a request with the following criteria:

  • is a POST request
  • has a Content-Type: application/x-www-form-urlencoded header and body
  • the first field in the form has the name _method and a valid HTTP method as the value
  • the value of the _method field matches the specified HTTP method

Typically HTML forms can only be submitted as GET or POST requests, so this filter allows for submitting forms using any HTTP method.