mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-30 10:42:55 +01:00
Add ServiceRequest::set_payload() method
This commit is contained in:
parent
babf48c550
commit
ded1e86e7e
@ -4,6 +4,8 @@
|
||||
|
||||
### Add
|
||||
|
||||
* Add `ServiceRequest::set_payload()` method.
|
||||
|
||||
* Add `test::TestRequest::set_json()` convenience method to automatically
|
||||
serialize data and set header in test requests.
|
||||
|
||||
|
@ -189,6 +189,11 @@ impl ServiceRequest {
|
||||
}
|
||||
}
|
||||
|
||||
/// Set request payload.
|
||||
pub fn set_payload(&mut self, payload: Payload) {
|
||||
Rc::get_mut(&mut (self.0).0).unwrap().payload = payload;
|
||||
}
|
||||
|
||||
#[doc(hidden)]
|
||||
/// Set new app data container
|
||||
pub fn set_data_container(&mut self, extensions: Rc<Extensions>) {
|
||||
|
Loading…
Reference in New Issue
Block a user