http_type/utils/
request.rs

1use crate::*;
2
3/// Combines a content type and a charset value into a single formatted string.
4///
5/// - `content_type`: The content type (e.g., `"text/html"`).
6/// - `charset`: The character set (e.g., `"utf-8"`).
7/// - Returns: A format string.
8pub fn content_type_charset(content_type: &str, charset: &str) -> String {
9    format!(
10        "{}{}{}{}",
11        content_type, SEMICOLON_SPACE, CHARSET_EQUAL, charset
12    )
13}
14
15/// Combines a content type and a charset into a single formatted string.
16///
17/// - `content_type`: The content type (e.g., `"text/html"`).
18/// - `charset`: The character set (e.g., `"charset=utf-8"`).
19/// - Returns: A format string.
20pub fn content_type_charset_with_key(content_type: &str, charset_with_key: &str) -> String {
21    format!("{}{}{}", content_type, SEMICOLON_SPACE, charset_with_key)
22}