Response bytes #130
Unanswered
josejachuf
asked this question in
Q&A
Replies: 1 comment 3 replies
-
#[handler]
async fn example(res: &mut Response) {
res.header_mut().insert("content-type".parse().unwrap(), "application/octet-stream".parse().unwrap());
res.set_body(Body::Once(Bytes::from(b"hello")));
} https://docs.rs/salvo_core/latest/salvo_core/http/response/struct.Response.html#method.set_body |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
How to do a Response as type bytes?
I want server vector tiles [1] from postgres/postgis
The Content-Type is application/octet-stream
the query is similar to this (python):
Thanks
Jose
[1] https://en.wikipedia.org/wiki/Vector_tiles
Beta Was this translation helpful? Give feedback.
All reactions