Skip to content

How to convert streaming body to a string? #2749

Answered by orhun
orhun asked this question in Q&A
Discussion options

You must be logged in to vote

I figured it out 🐻

let body_bytes = actix_web::body::to_bytes(body).await.unwrap();
let body_text = str::from_utf8(&body_bytes).unwrap();

Thanks to to_bytes

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by orhun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant