pub struct UreqHttpClient { /* private fields */ }Expand description
HttpClient backed by ureq with rustls + bundled Mozilla roots.
Implementations§
Source§impl UreqHttpClient
impl UreqHttpClient
pub fn new() -> UreqHttpClient
Trait Implementations§
Source§impl Default for UreqHttpClient
Available on crate feature http-client only.
impl Default for UreqHttpClient
Available on crate feature
http-client only.Source§fn default() -> UreqHttpClient
fn default() -> UreqHttpClient
Returns the “default value” for a type. Read more
Source§impl HttpClient for UreqHttpClient
Available on crate feature http-client only.
impl HttpClient for UreqHttpClient
Available on crate feature
http-client only.Source§fn get(
&self,
url: &str,
headers: &[(&str, &str)],
) -> Result<HttpResponse, GitError>
fn get( &self, url: &str, headers: &[(&str, &str)], ) -> Result<HttpResponse, GitError>
Issue a
GET for url, sending the additional headers.Source§fn post(
&self,
url: &str,
content_type: &str,
headers: &[(&str, &str)],
body: &[u8],
) -> Result<HttpResponse, GitError>
fn post( &self, url: &str, content_type: &str, headers: &[(&str, &str)], body: &[u8], ) -> Result<HttpResponse, GitError>
Issue a
POST for url with body, sending content_type and the
additional headers.Source§fn post_reader(
&self,
url: &str,
content_type: &str,
headers: &[(&str, &str)],
body: &mut dyn Read,
) -> Result<HttpResponse, GitError>
fn post_reader( &self, url: &str, content_type: &str, headers: &[(&str, &str)], body: &mut dyn Read, ) -> Result<HttpResponse, GitError>
Issue a
POST whose body is streamed from body with chunked
transfer-encoding (no Content-Length), so large request bodies never
have to be held in memory. The default implementation buffers body and
delegates to HttpClient::post; transports that can stream the request
(e.g. UreqHttpClient) override this. Callers that need retry-on-auth
must be able to regenerate body per attempt, since a reader is consumed
once.Auto Trait Implementations§
impl !RefUnwindSafe for UreqHttpClient
impl !UnwindSafe for UreqHttpClient
impl Freeze for UreqHttpClient
impl Send for UreqHttpClient
impl Sync for UreqHttpClient
impl Unpin for UreqHttpClient
impl UnsafeUnpin for UreqHttpClient
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