pub struct HttpClient { /* private fields */ }Expand description
HTTP client
Implementations§
Source§impl HttpClient
impl HttpClient
Sourcepub const fn new(
device: &'static NetworkDevice,
processor: &'static AtProcessor,
timeout: Duration,
) -> Self
pub const fn new( device: &'static NetworkDevice, processor: &'static AtProcessor, timeout: Duration, ) -> Self
Create a new HTTP client
Sourcepub async fn request<SPI, CS>(
&self,
spi: &'static TmMutex<SpiTransport<SPI, CS>>,
request: &HttpRequest,
) -> Result<HttpResponse>
pub async fn request<SPI, CS>( &self, spi: &'static TmMutex<SpiTransport<SPI, CS>>, request: &HttpRequest, ) -> Result<HttpResponse>
Send an HTTP request
Sourcepub async fn get<SPI, CS>(
&self,
spi: &'static TmMutex<SpiTransport<SPI, CS>>,
url: &str,
) -> Result<HttpResponse>
pub async fn get<SPI, CS>( &self, spi: &'static TmMutex<SpiTransport<SPI, CS>>, url: &str, ) -> Result<HttpResponse>
Perform a GET request
Sourcepub async fn post<SPI, CS>(
&self,
spi: &'static TmMutex<SpiTransport<SPI, CS>>,
url: &str,
body: &[u8],
) -> Result<HttpResponse>
pub async fn post<SPI, CS>( &self, spi: &'static TmMutex<SpiTransport<SPI, CS>>, url: &str, body: &[u8], ) -> Result<HttpResponse>
Perform a POST request
Auto Trait Implementations§
impl Freeze for HttpClient
impl !RefUnwindSafe for HttpClient
impl Send for HttpClient
impl Sync for HttpClient
impl Unpin for HttpClient
impl !UnwindSafe 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