Trait oxide_auth::code_grant::frontend::WebRequest
[−]
[src]
pub trait WebRequest { type Error: From<OAuthError>; type Response: WebResponse<Error = Self::Error>; fn query(&mut self) -> Result<Cow<HashMap<String, Vec<String>>>, ()>; fn urlbody(&mut self) -> Result<Cow<HashMap<String, Vec<String>>>, ()>; fn authheader(&mut self) -> Result<Option<Cow<str>>, ()>; }
Abstraction of web requests with several different abstractions and constructors needed by this frontend. It is assumed to originate from an HTTP request, as defined in the scope of the rfc, but theoretically other requests are possible.
Associated Types
type Error: From<OAuthError>
The error generated from access of malformed or invalid requests.
type Response: WebResponse<Error = Self::Error>
The corresponding type of Responses returned from this module.
Required Methods
fn query(&mut self) -> Result<Cow<HashMap<String, Vec<String>>>, ()>
Retrieve a parsed version of the url query. An Err return value indicates a malformed query
or an otherwise malformed WebRequest. Note that an empty query should result in
Ok(HashMap::new())
instead of an Err.
fn urlbody(&mut self) -> Result<Cow<HashMap<String, Vec<String>>>, ()>
Retriev the parsed application/x-form-urlencoded
body of the request. An Err value
indicates a malformed body or a different Content-Type.
fn authheader(&mut self) -> Result<Option<Cow<str>>, ()>
Contents of the authorization header or none if none exists. An Err value indicates a malformed header or request.