pub struct HttpRequest {
pub method: Method,
pub url: Url,
pub headers: HeaderMap,
pub body: HttpBody,
pub timeout: Option<Duration>,
pub cancellation: Option<CancellationToken>,
pub multipart: Option<Form>,
}Expand description
Prepared HTTP request passed to a backend.
Fields§
§method: MethodHTTP method.
url: UrlFully resolved URL.
headers: HeaderMapRequest headers.
body: HttpBodyBody when not using multipart.
timeout: Option<Duration>Per-request timeout.
cancellation: Option<CancellationToken>Cooperative cancellation.
multipart: Option<Form>Available on crate feature
multipart only.Multipart form (feature multipart).
Trait Implementations§
Source§impl Clone for HttpRequest
impl Clone for HttpRequest
Source§impl Debug for HttpRequest
impl Debug for HttpRequest
Source§impl Service<HttpRequest> for ReqwestHttpService
Available on crate feature tower only.
impl Service<HttpRequest> for ReqwestHttpService
Available on crate feature
tower only.Source§type Response = HttpResponse
type Response = HttpResponse
Responses given by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<HttpResponse, Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<HttpResponse, Error>> + Send>>
The future response value.
Source§impl Service<HttpRequest> for ReqwestStreamingHttpService
Available on crate feature tower only.
impl Service<HttpRequest> for ReqwestStreamingHttpService
Available on crate feature
tower only.Source§type Response = HttpStreamingResponse
type Response = HttpStreamingResponse
Responses given by the service.
Source§type Future = Pin<Box<dyn Future<Output = Result<HttpStreamingResponse, Error>> + Send>>
type Future = Pin<Box<dyn Future<Output = Result<HttpStreamingResponse, Error>> + Send>>
The future response value.
Auto Trait Implementations§
impl !Freeze for HttpRequest
impl !RefUnwindSafe for HttpRequest
impl Send for HttpRequest
impl Sync for HttpRequest
impl Unpin for HttpRequest
impl UnsafeUnpin for HttpRequest
impl !UnwindSafe for HttpRequest
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