how do Response File stream #572
Answered
by
robjtede
bouyeijiang
asked this question in
Q&A
-
how Response File stream download the file |
Beta Was this translation helpful? Give feedback.
Answered by
robjtede
Sep 6, 2022
Replies: 3 comments 1 reply
-
Use async fn handler() -> web::Either<web::Json<XX>, NamedFile>> {
// or
async fn handler() -> web::Either<HttpResponse, NamedFile>> {
...
Either::Left(HttpResponse::Ok().json(xx)) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
robjtede
-
I want a method that supports both JSON and file streams |
Beta Was this translation helpful? Give feedback.
1 reply
-
Oh,i see |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use
NamedFile
inactix-files
crate.