pub struct Request<'c> {
pub method: Method,
pub url: Url,
pub headers: Result<HeaderMap>,
pub payload: Option<Body>,
pub client: &'c Client,
pub log_settings: &'c LogSettings,
pub basic_auth: Option<BasicAuth>,
pub bearer_auth: Option<BearerToken>,
}Expand description
Represents an outgoing http request.
Can be executed with Request::assert().
Fields§
§method: MethodThe http request method.
url: UrlThe http request url.
headers: Result<HeaderMap>The http request headers.
payload: Option<Body>The http request payload.
client: &'c ClientThe client used for this outgoing request.
log_settings: &'c LogSettingsThe log settings that will be used to output test results when asserting the http response.
basic_auth: Option<BasicAuth>Basic authenthication information.
bearer_auth: Option<BearerToken>Bearer authentication token.
Implementations§
Source§impl Request<'_>
impl Request<'_>
Sourcepub fn headers<H: RequestHeaders>(self, headers: H) -> Self
pub fn headers<H: RequestHeaders>(self, headers: H) -> Self
Sourcepub fn basic_auth<U, P>(self, username: U, password: Option<P>) -> Self
pub fn basic_auth<U, P>(self, username: U, password: Option<P>) -> Self
Enable HTTP basic authentication.
Basic authentication will automatically be considered as a sensitive header.
Sourcepub fn bearer_auth<T>(self, token: T) -> Self
pub fn bearer_auth<T>(self, token: T) -> Self
Enable HTTP bearer authentication.
Bearer authentication will automatically be considered as a sensitive header.
Auto Trait Implementations§
impl<'c> !Freeze for Request<'c>
impl<'c> !RefUnwindSafe for Request<'c>
impl<'c> Send for Request<'c>
impl<'c> Sync for Request<'c>
impl<'c> Unpin for Request<'c>
impl<'c> !UnwindSafe for Request<'c>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more