feat(header): add ContentType::xml() constructor
This commit is contained in:
committed by
Sean McArthur
parent
77bfcd9515
commit
92595e84a2
@@ -68,12 +68,18 @@ impl ContentType {
|
|||||||
ContentType(mime::TEXT_PLAIN_UTF_8)
|
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]
|
#[inline]
|
||||||
pub fn html() -> ContentType {
|
pub fn html() -> ContentType {
|
||||||
ContentType(mime::TEXT_HTML)
|
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.
|
/// A constructor to easily create a `Content-Type: application/www-form-url-encoded` header.
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn form_url_encoded() -> ContentType {
|
pub fn form_url_encoded() -> ContentType {
|
||||||
|
|||||||
Reference in New Issue
Block a user