Skip to content

Commit

Permalink
Merge pull request #499 from Fishrock123/response-take-body
Browse files Browse the repository at this point in the history
Response: add `take_body()` as a way to get the body from a Response
  • Loading branch information
yoshuawuyts authored May 13, 2020
2 parents 999c30c + 3953af3 commit 15272f9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ impl Response {
// })
// }

/// Take the request body, replacing it with an empty body.
pub fn take_body(&mut self) -> Body {
self.res.take_body()
}

/// Add cookie to the cookie jar.
pub fn set_cookie(&mut self, cookie: Cookie<'static>) {
self.cookie_events.push(CookieEvent::Added(cookie));
Expand Down

0 comments on commit 15272f9

Please sign in to comment.