Skip to content

Commit

Permalink
feat(header): add ContentType::form_url_encoded() constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed May 16, 2015
1 parent e9dcf45 commit 2c99d4e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/header/common/content_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ impl ContentType {
ContentType(mime!(Text/Html; Charset=Utf8))
}

/// A constructor to easily create a `Content-Type: application/www-form-url-encoded` header.
#[inline]
pub fn form_url_encoded() -> ContentType {
ContentType(mime!(Application/WwwFormUrlEncoded))
}
/// A constructor to easily create a `Content-Type: image/jpeg` header.
#[inline]
pub fn jpeg() -> ContentType {
Expand All @@ -65,4 +70,5 @@ impl ContentType {
ContentType(mime!(Image/Png))
}
}

bench_header!(bench, ContentType, { vec![b"application/json; charset=utf-8".to_vec()] });

0 comments on commit 2c99d4e

Please sign in to comment.