此前版本需要手动设置该响应头,比如:
async fn cn() -> (HeaderMap, &'static str) {
let mut headers = HeaderMap::new();
headers.insert(
HeaderName::from_static("content-type"),
HeaderValue::from_static("text/plain;charset=utf-8"),
);
(headers, "你好,axum.rs")
}