docs(headers): add header examples

This commit is contained in:
Chandler Latour
2015-05-28 08:55:32 -06:00
parent 5a9c41a2a1
commit c940e84a78
41 changed files with 856 additions and 0 deletions

View File

@@ -17,6 +17,21 @@ header! {
#[doc=""]
#[doc="# Example values"]
#[doc="* `Sat, 29 Oct 1994 19:43:31 GMT`"]
#[doc=""]
#[doc="# Example"]
#[doc="```"]
#[doc="# extern crate hyper;"]
#[doc="# extern crate time;"]
#[doc="# fn main() {"]
#[doc="// extern crate time;"]
#[doc=""]
#[doc="use hyper::header::{Headers, IfModifiedSince, HttpDate};"]
#[doc="use time::{self, Duration};"]
#[doc=""]
#[doc="let mut headers = Headers::new();"]
#[doc="headers.set(IfModifiedSince(HttpDate(time::now() - Duration::days(1))));"]
#[doc="# }"]
#[doc="```"]
(IfModifiedSince, "If-Modified-Since") => [HttpDate]
test_if_modified_since {