pub struct Http { /* private fields */ }Expand description
Clone-cheap handle over an HttpClient. Methods mirror reqwest::Client.
Implementations§
Source§impl Http
impl Http
pub fn new<C: HttpClient>(client: C) -> Self
pub fn from_arc(inner: Arc<dyn HttpClient>) -> Self
pub fn as_arc(&self) -> &Arc<dyn HttpClient>
pub fn request( &self, method: Method, url: impl Into<String>, ) -> HttpRequestBuilder
pub fn get(&self, url: impl Into<String>) -> HttpRequestBuilder
pub fn post(&self, url: impl Into<String>) -> HttpRequestBuilder
pub fn put(&self, url: impl Into<String>) -> HttpRequestBuilder
pub fn delete(&self, url: impl Into<String>) -> HttpRequestBuilder
pub fn patch(&self, url: impl Into<String>) -> HttpRequestBuilder
pub async fn execute( &self, request: HttpRequest, ) -> Result<HttpResponse, HttpError>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Http
impl !UnwindSafe for Http
impl Freeze for Http
impl Send for Http
impl Sync for Http
impl Unpin for Http
impl UnsafeUnpin for Http
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