hyperx/header/common/
access_control_request_method.rs

1use method::Method;
2
3header! {
4    /// `Access-Control-Request-Method` header, part of
5    /// [CORS](http://www.w3.org/TR/cors/#access-control-request-method-request-header)
6    ///
7    /// The `Access-Control-Request-Method` header indicates which method will be
8    /// used in the actual request as part of the preflight request.
9    /// # ABNF
10    ///
11    /// ```text
12    /// Access-Control-Request-Method: \"Access-Control-Request-Method\" \":\" Method
13    /// ```
14    ///
15    /// # Example values
16    /// * `GET`
17    ///
18    /// # Examples
19    ///
20    /// ```
21    /// # extern crate http;
22    /// use hyperx::header::{AccessControlRequestMethod, TypedHeaders};
23    /// use hyperx::Method;
24    ///
25    /// let mut headers = http::HeaderMap::new();
26    /// headers.encode(&AccessControlRequestMethod(Method::Get));
27    /// ```
28    (AccessControlRequestMethod, "Access-Control-Request-Method") => [Method]
29
30    test_access_control_request_method {
31        test_header!(test1, vec![b"GET"]);
32    }
33}
34
35standard_header!(AccessControlRequestMethod, ACCESS_CONTROL_REQUEST_METHOD);