pub struct HttpRequestBuilder<State> { /* private fields */ }Implementations§
Source§impl HttpRequestBuilder<SetMethod>
impl HttpRequestBuilder<SetMethod>
Sourcepub fn get(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
pub fn get(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
Sets the HTTP method to GET and assigns the request URI.
Sourcepub fn post(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
pub fn post(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
Sets the HTTP method to POST and assigns the request URI.
Sourcepub fn put(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
pub fn put(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
Sets the HTTP method to PUT and assigns the request URI.
Sourcepub fn patch(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
pub fn patch(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
Sets the HTTP method to PATCH and assigns the request URI.
Sourcepub fn delete(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
pub fn delete(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
Sets the HTTP method to DELETE and assigns the request URI.
Sourcepub fn options(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
pub fn options(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
Sets the HTTP method to OPTIONS and assigns the request URI.
Sourcepub fn head(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
pub fn head(self, uri: impl Into<String>) -> HttpRequestBuilder<Final>
Sets the HTTP method to HEAD and assigns the request URI.
Source§impl HttpRequestBuilder<Final>
impl HttpRequestBuilder<Final>
Sourcepub fn body_empty(self) -> Result<HttpRequest>
pub fn body_empty(self) -> Result<HttpRequest>
Finish the builder and the create the request with an empty body.
Sourcepub fn body_boxed(self, body: BoxBody<Bytes, Error>) -> Result<HttpRequest>
pub fn body_boxed(self, body: BoxBody<Bytes, Error>) -> Result<HttpRequest>
Finish the builder and the create the request with a boxed body.
Used for moving a body from another request or response.
Sourcepub fn body_bytes(self, body: impl Into<Bytes>) -> Result<HttpRequest>
pub fn body_bytes(self, body: impl Into<Bytes>) -> Result<HttpRequest>
Finish the builder and the create the request with a body of bytes in memory.
Sourcepub fn body_stream<S>(self, stream: S) -> Result<HttpRequest>
pub fn body_stream<S>(self, stream: S) -> Result<HttpRequest>
Finish the builder and the create the request with a body of bytes as a stream.
Sourcepub fn header(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn header(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add a header to the request.
Sourcepub fn headers(self, headers: &HeaderMap<HeaderValue>) -> Self
pub fn headers(self, headers: &HeaderMap<HeaderValue>) -> Self
Copy headers from another request or response.