pub struct HttpClient {
pub base_url: String,
pub api_version: String,
/* private fields */
}Fields§
§base_url: String§api_version: StringImplementations§
Source§impl HttpClient
impl HttpClient
pub fn new(config: &HighLevelConfig) -> Self
pub async fn set_token(&self, token: String)
pub async fn get_token(&self) -> Option<String>
pub async fn get<T: DeserializeOwned>(&self, path: &str) -> Result<T>
pub async fn get_with_query<T: DeserializeOwned, Q: Serialize + ?Sized>( &self, path: &str, query: &Q, ) -> Result<T>
pub async fn post<T: DeserializeOwned, B: Serialize>( &self, path: &str, body: &B, ) -> Result<T>
pub async fn put<T: DeserializeOwned, B: Serialize>( &self, path: &str, body: &B, ) -> Result<T>
pub async fn patch<T: DeserializeOwned, B: Serialize>( &self, path: &str, body: &B, ) -> Result<T>
pub async fn delete<T: DeserializeOwned>(&self, path: &str) -> Result<T>
pub async fn delete_with_body<T: DeserializeOwned, B: Serialize>( &self, path: &str, body: &B, ) -> Result<T>
pub async fn delete_no_content(&self, path: &str) -> Result<()>
pub async fn get_raw(&self, path: &str) -> Result<Response>
pub async fn post_raw<B: Serialize>( &self, path: &str, body: &B, ) -> Result<Response>
Auto Trait Implementations§
impl !Freeze for HttpClient
impl !RefUnwindSafe for HttpClient
impl !UnwindSafe for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl UnsafeUnpin for HttpClient
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