Struct hyper::header::AccessControlAllowMethods [] [src]

pub struct AccessControlAllowMethods(pub Vec<Method>);

Access-Control-Allow-Methods header, part of CORS

The Access-Control-Allow-Methods header indicates, as part of the response to a preflight request, which methods can be used during the actual request.

ABNF

Access-Control-Allow-Methods: "Access-Control-Allow-Methods" ":" #Method

Example values

  • PUT, DELETE, XMODIFY

Examples

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

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

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