pub struct RequestBuilder { /* private fields */ }Expand description
Request builder for fluent API construction
Implementations§
Source§impl RequestBuilder
impl RequestBuilder
pub fn new(method: HttpMethod, url: String) -> Self
pub fn get(url: String) -> Self
pub fn post(url: String) -> Self
pub fn put(url: String) -> Self
pub fn delete(url: String) -> Self
pub fn header(self, key: String, value: String) -> Self
pub fn headers(self, headers: HashMap<String, String>) -> Self
pub fn query(self, key: String, value: String) -> Self
pub fn json<T: Serialize + ?Sized>(self, body: &T) -> Result<Self, ApiError>
pub fn text(self, body: String) -> Self
pub fn build(self) -> ApiRequest
Auto Trait Implementations§
impl Freeze for RequestBuilder
impl RefUnwindSafe for RequestBuilder
impl Send for RequestBuilder
impl Sync for RequestBuilder
impl Unpin 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more