Struct hyper::header::Allow [] [src]

pub struct Allow(pub Vec<Method>);

Allow header, defined in RFC7231

The Allow header field lists the set of methods advertised as supported by the target resource. The purpose of this field is strictly to inform the recipient of valid request methods associated with the resource.

ABNF

Allow = #method

Example values

Examples

use hyper::header::{Headers, Allow};
use hyper::method::Method;

let mut headers = Headers::new();
headers.set(
    Allow(vec![Method::Get])
);
use hyper::header::{Headers, Allow};
use hyper::method::Method;

let mut headers = Headers::new();
headers.set(
    Allow(vec![
        Method::Get,
        Method::Post,
        Method::Patch,
        Method::Extension("COPY".to_owned()),
    ])
);