Skip to content

Commit 15272f9

Browse files
authored
Merge pull request #499 from Fishrock123/response-take-body
Response: add `take_body()` as a way to get the body from a Response
2 parents 999c30c + 3953af3 commit 15272f9

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/response.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ impl Response {
218218
// })
219219
// }
220220

221+
/// Take the request body, replacing it with an empty body.
222+
pub fn take_body(&mut self) -> Body {
223+
self.res.take_body()
224+
}
225+
221226
/// Add cookie to the cookie jar.
222227
pub fn set_cookie(&mut self, cookie: Cookie<'static>) {
223228
self.cookie_events.push(CookieEvent::Added(cookie));

0 commit comments

Comments
 (0)