Enum vertigo::RequestBuilder
source · pub enum RequestBuilder {
ErrorInput(String),
Data {
api: ApiImport,
url: String,
headers: Option<HashMap<String, String>>,
body: Option<String>,
},
}
Expand description
Builder for typed requests (more complex version of FetchBuilder).
Unlike in the FetchBuilder, here request and response data is a type implementing SingleRequestTrait or ListRequestTrait.
Variants
ErrorInput(String)
Data
Implementations
sourceimpl RequestBuilder
impl RequestBuilder
pub fn new(api: &ApiImport, url: impl Into<String>) -> RequestBuilder
pub fn body(self, body: String) -> RequestBuilder
pub fn bearer_auth(self, token: impl Into<String>) -> RequestBuilder
pub fn set_header(
self,
name: impl Into<String>,
value: impl Into<String>
) -> RequestBuilder
pub fn body_json(self, body: impl SingleRequestTrait) -> RequestBuilder
pub fn headers(self, headers: HashMap<String, String>) -> RequestBuilder
pub async fn get(self) -> RequestResponse
pub async fn post(self) -> RequestResponse
Auto Trait Implementations
impl !RefUnwindSafe for RequestBuilder
impl !Send for RequestBuilder
impl !Sync for RequestBuilder
impl Unpin for RequestBuilder
impl !UnwindSafe for RequestBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more