Missing easier way to return text/html content
Open
- Dominant language
- Rust
- Stars
- 5.1k
- Forks
- 329
- PR merge metrics
- No merged PRs in 30d
Description
Looking at the 'graphql' example, I have to depend on the mime crate to set `text/html` content-type:
```
let res = Response::new(StatusCode::Ok)
.body_string(body)
.set_mime(mime::TEXT_HTML_UTF_8);
```
if I don't want to depend on the `mime` crate, I can do:
```
let res = Response::new(StatusCode::Ok)
.body_string(body)
.set_mime("text/html".parse().unwrap());
```
This looks non-optimal to me.
Such a basic use-case should be easier. I am wondering if I am missing an alternative.
Contributor guide
Assessment
This issue has not been assessed yet.