docs(headers): add header examples
This commit is contained in:
@@ -15,6 +15,31 @@ header! {
|
||||
#[doc=""]
|
||||
#[doc="# Example values"]
|
||||
#[doc="* `PUT, DELETE, XMODIFY`"]
|
||||
#[doc=""]
|
||||
#[doc="# Examples"]
|
||||
#[doc="```"]
|
||||
#[doc="use hyper::header::{Headers, AccessControlAllowMethods};"]
|
||||
#[doc="use hyper::method::Method;"]
|
||||
#[doc=""]
|
||||
#[doc="let mut headers = Headers::new();"]
|
||||
#[doc="headers.set("]
|
||||
#[doc=" AccessControlAllowMethods(vec![Method::Get])"]
|
||||
#[doc=");"]
|
||||
#[doc="```"]
|
||||
#[doc="```"]
|
||||
#[doc="use hyper::header::{Headers, AccessControlAllowMethods};"]
|
||||
#[doc="use hyper::method::Method;"]
|
||||
#[doc=""]
|
||||
#[doc="let mut headers = Headers::new();"]
|
||||
#[doc="headers.set("]
|
||||
#[doc=" AccessControlAllowMethods(vec!["]
|
||||
#[doc=" Method::Get,"]
|
||||
#[doc=" Method::Post,"]
|
||||
#[doc=" Method::Patch,"]
|
||||
#[doc=" Method::Extension(\"COPY\".to_owned()),"]
|
||||
#[doc=" ])"]
|
||||
#[doc=");"]
|
||||
#[doc="```"]
|
||||
(AccessControlAllowMethods, "Access-Control-Allow-Methods") => (Method)*
|
||||
|
||||
test_access_control_allow_methods {
|
||||
|
||||
Reference in New Issue
Block a user