[−][src]Trait sputnik::request::SputnikBody
Required methods
#[must_use]fn into_bytes<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = Result<Bytes, BodyError>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]
self
) -> Pin<Box<dyn Future<Output = Result<Bytes, BodyError>> + Send + 'async_trait>> where
Self: 'async_trait,
#[must_use]fn into_form<'async_trait, T: DeserializeOwned>(
self
) -> Pin<Box<dyn Future<Output = Result<T, FormError>> + Send + 'async_trait>> where
T: 'async_trait,
Self: 'async_trait,
[src]
self
) -> Pin<Box<dyn Future<Output = Result<T, FormError>> + Send + 'async_trait>> where
T: 'async_trait,
Self: 'async_trait,
Parses a application/x-www-form-urlencoded
request body into a given struct.
This does make you vulnerable to CSRF, so you normally want to use
SputnikBody::into_form_csrf()
instead.
#[must_use]fn into_form_csrf<'life0, 'async_trait, T: DeserializeOwned>(
self,
req: &'life0 mut Parts
) -> Pin<Box<dyn Future<Output = Result<T, CsrfProtectedFormError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
self,
req: &'life0 mut Parts
) -> Pin<Box<dyn Future<Output = Result<T, CsrfProtectedFormError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Parses a application/x-www-form-urlencoded
request body into a given struct.
Protects from CSRF by checking that the request body contains the same token retrieved from the cookies.
The HTML form must embed a hidden input generated with CsrfToken::html_input
.
#[must_use]fn into_json<'async_trait, T: DeserializeOwned>(
self
) -> Pin<Box<dyn Future<Output = Result<T, JsonError>> + Send + 'async_trait>> where
T: 'async_trait,
Self: 'async_trait,
[src]
self
) -> Pin<Box<dyn Future<Output = Result<T, JsonError>> + Send + 'async_trait>> where
T: 'async_trait,
Self: 'async_trait,
This is supported on crate feature
json
only.Attempts to deserialize the request body as JSON.
Implementations on Foreign Types
impl SputnikBody for Body
[src]
fn into_bytes<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = Result<Bytes, BodyError>> + Send + 'async_trait>> where
Self: 'async_trait,
[src]
self
) -> Pin<Box<dyn Future<Output = Result<Bytes, BodyError>> + Send + 'async_trait>> where
Self: 'async_trait,
fn into_form<'async_trait, T: DeserializeOwned>(
self
) -> Pin<Box<dyn Future<Output = Result<T, FormError>> + Send + 'async_trait>> where
T: 'async_trait,
Self: 'async_trait,
[src]
self
) -> Pin<Box<dyn Future<Output = Result<T, FormError>> + Send + 'async_trait>> where
T: 'async_trait,
Self: 'async_trait,
fn into_form_csrf<'life0, 'async_trait, T: DeserializeOwned>(
self,
req: &'life0 mut Parts
) -> Pin<Box<dyn Future<Output = Result<T, CsrfProtectedFormError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
self,
req: &'life0 mut Parts
) -> Pin<Box<dyn Future<Output = Result<T, CsrfProtectedFormError>> + Send + 'async_trait>> where
T: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn into_json<'async_trait, T: DeserializeOwned>(
self
) -> Pin<Box<dyn Future<Output = Result<T, JsonError>> + Send + 'async_trait>> where
T: 'async_trait,
Self: 'async_trait,
[src]
self
) -> Pin<Box<dyn Future<Output = Result<T, JsonError>> + Send + 'async_trait>> where
T: 'async_trait,
Self: 'async_trait,