pub struct Request { /* private fields */ }
Expand description
A Request representation for handling incoming and creating outbound HTTP requests.
Implementations
sourceimpl Request
impl Request
sourcepub fn new(uri: &str, method: Method) -> Result<Self>
pub fn new(uri: &str, method: Method) -> Result<Self>
Construct a new Request
with an HTTP Method.
sourcepub fn new_with_init(uri: &str, init: &RequestInit) -> Result<Self>
pub fn new_with_init(uri: &str, init: &RequestInit) -> Result<Self>
Construct a new Request
with a RequestInit
configuration.
sourcepub async fn json<B: DeserializeOwned>(&mut self) -> Result<B>
pub async fn json<B: DeserializeOwned>(&mut self) -> Result<B>
Access this request’s body encoded as JSON.
sourcepub async fn form_data(&mut self) -> Result<FormData>
pub async fn form_data(&mut self) -> Result<FormData>
Access this request’s body as a form-encoded payload and pull out fields and files.
sourcepub fn headers_mut(&mut self) -> Result<&mut Headers>
pub fn headers_mut(&mut self) -> Result<&mut Headers>
Get a mutable reference to this request’s Headers
.
Note: they can only be modified if the request was created from scratch or cloned.
sourcepub fn path_mut(&mut self) -> Result<&mut String>
pub fn path_mut(&mut self) -> Result<&mut String>
Get a mutable reference to this request’s path. Note: they can only be modified if the request was created from scratch or cloned.
pub fn clone(&self) -> Result<Self>
pub fn inner(&self) -> &EdgeRequest
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Request
impl !Send for Request
impl !Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more