-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
blocking::Client Local Response response.body().unwrap().into_string() returns Future<Output = Option<String>> #1573
Comments
With async client, you can't use into_string
|
That's what |
I'm reading the docs carefully, into_string() fails for blocking client because it returns a future, and so can't be used in If you try and use blocking in a regular when I try and use #[async_test], i must use async client, and then it fails with the following for into_string() let body = response.body().unwrap().into_string().await
|
Oh, there are two into_string(), one on response, and one on body. To me, if I want the body as a string, I should call it on body. It looks like body.into_string() might have wrong visibility then. |
It does not have the wrong visibility. The body is retrievable should you need to inspect it directly. If you need to simply read it, we provide helper methods on LocalResponse. All of the documentation, including the guide, the module levels docs, and the struct level docs point to these helper methods. None point to using I don't believe there is anything to be done here, so I'm closing this out. |
This makes it hard to use from sync tests. :)
0.5.0-dev
The text was updated successfully, but these errors were encountered: