pub struct UreqClient { /* private fields */ }Expand description
Production HTTP client backed by ureq::Agent.
Automatically attaches User-Agent and GitHub Authorization headers
to every request. The GitHub token is discovered once from environment
variables or the gh CLI and cached for the process lifetime.
Implementations§
Source§impl UreqClient
impl UreqClient
Trait Implementations§
Source§impl Default for UreqClient
impl Default for UreqClient
Source§impl HttpClient for UreqClient
impl HttpClient for UreqClient
Source§fn get_bytes(&self, url: &str) -> Result<Vec<u8>, SkillfileError>
fn get_bytes(&self, url: &str) -> Result<Vec<u8>, SkillfileError>
GET a URL and return the response body as raw bytes. Read more
Source§fn get_json(&self, url: &str) -> Result<Option<String>, SkillfileError>
fn get_json(&self, url: &str) -> Result<Option<String>, SkillfileError>
GET a URL with
Accept: application/vnd.github.v3+json header. Read moreSource§fn post_json(&self, url: &str, body: &str) -> Result<Vec<u8>, SkillfileError>
fn post_json(&self, url: &str, body: &str) -> Result<Vec<u8>, SkillfileError>
POST a JSON body to a URL and return the response body as bytes. Read more
Source§fn post_json_with_bearer(
&self,
req: &BearerPost<'_>,
) -> Result<Vec<u8>, SkillfileError>
fn post_json_with_bearer( &self, req: &BearerPost<'_>, ) -> Result<Vec<u8>, SkillfileError>
POST with a custom
Authorization: Bearer header (for non-GitHub APIs). Read moreAuto Trait Implementations§
impl Freeze for UreqClient
impl !RefUnwindSafe for UreqClient
impl Send for UreqClient
impl Sync for UreqClient
impl Unpin for UreqClient
impl UnsafeUnpin for UreqClient
impl !UnwindSafe for UreqClient
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