Skip to content

Commit

Permalink
feat(header): add ContentType::xml() constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
spk authored and seanmonstar committed Sep 22, 2017
1 parent 77bfcd9 commit 92595e8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/header/common/content_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,18 @@ impl ContentType {
ContentType(mime::TEXT_PLAIN_UTF_8)
}

/// A constructor to easily create a `Content-Type: text/html; charset=utf-8` header.
/// A constructor to easily create a `Content-Type: text/html` header.
#[inline]
pub fn html() -> ContentType {
ContentType(mime::TEXT_HTML)
}

/// A constructor to easily create a `Content-Type: text/xml` header.
#[inline]
pub fn xml() -> ContentType {
ContentType(mime::TEXT_XML)
}

/// A constructor to easily create a `Content-Type: application/www-form-url-encoded` header.
#[inline]
pub fn form_url_encoded() -> ContentType {
Expand Down

0 comments on commit 92595e8

Please sign in to comment.