-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Add Response::text()? #86
Comments
The returned Alternatively, since it seems to be so common to read the body to a string, I wonder if there is value in providing |
Good point. |
|
+1 for a |
I can add this in |
I currently have it here in question form as I'd like to hear if it's worth having, or to continue to recommend the |
I see. I think it's worth having since it's probably the most likely case other than deserializing into json. The convenience and the consumption of the response is certainly a plus. |
One argument in favor of adding the method: without this, you have to |
* fix: Add new patterns for backtrace cleaning * feat: Use fuzzy matching for well known system frame detection
Currently, you can run into a (somewhat) surprising condition when you read the body of a Response twice.
resp.json()
or just
While to many it will occur quickly that the problem is reading the response twice, I think this can be improved.
.json()
already consumes the response, but theRead
trait methods do not.Maybe there could be a
body()
method which returns aRead
and also consumes the response.The text was updated successfully, but these errors were encountered: