pub struct RequestBuilder { /* private fields */ }Expand description
Implementations§
Source§impl RequestBuilder
impl RequestBuilder
Sourcepub fn get(url: impl Into<String>) -> Option<Self>
pub fn get(url: impl Into<String>) -> Option<Self>
Create a new GET request builder
Returns None if URL is invalid or too long.
Sourcepub fn post(url: impl Into<String>) -> Option<Self>
pub fn post(url: impl Into<String>) -> Option<Self>
Create a new POST request builder
Returns None if URL is invalid or too long.
Sourcepub fn put(url: impl Into<String>) -> Option<Self>
pub fn put(url: impl Into<String>) -> Option<Self>
Create a new PUT request builder
Returns None if URL is invalid or too long.
Sourcepub fn delete(url: impl Into<String>) -> Option<Self>
pub fn delete(url: impl Into<String>) -> Option<Self>
Create a new DELETE request builder
Returns None if URL is invalid or too long.
Sourcepub fn patch(url: impl Into<String>) -> Option<Self>
pub fn patch(url: impl Into<String>) -> Option<Self>
Create a new PATCH request builder
Returns None if URL is invalid or too long.
Sourcepub fn param(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn param(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add a query parameter
Sourcepub fn bearer_auth(self, token: impl Into<String>) -> Self
pub fn bearer_auth(self, token: impl Into<String>) -> Self
Set bearer token authorization
Sourcepub fn basic_auth(
self,
username: impl Into<String>,
password: impl Into<String>,
) -> Self
pub fn basic_auth( self, username: impl Into<String>, password: impl Into<String>, ) -> Self
Set basic authorization
Sourcepub fn build(self) -> HttpRequest
pub fn build(self) -> HttpRequest
Build the request
Auto Trait Implementations§
impl Freeze for RequestBuilder
impl RefUnwindSafe for RequestBuilder
impl Send for RequestBuilder
impl Sync for RequestBuilder
impl Unpin for RequestBuilder
impl UnsafeUnpin for RequestBuilder
impl UnwindSafe for RequestBuilder
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