pub struct Curl { /* private fields */ }
Available on crate features
blocking-client
and http-client
and http-client-curl
only.Expand description
A utility to abstract interactions with curl handles.
Trait Implementations§
source§impl Http for Curl
impl Http for Curl
§type ResponseBody = Reader
type ResponseBody = Reader
A type providing the response.
source§fn get(
&mut self,
url: &str,
base_url: &str,
headers: impl IntoIterator<Item = impl AsRef<str>>
) -> Result<GetResponse<Self::Headers, Self::ResponseBody>, Error>
fn get( &mut self, url: &str, base_url: &str, headers: impl IntoIterator<Item = impl AsRef<str>> ) -> Result<GetResponse<Self::Headers, Self::ResponseBody>, Error>
Initiate a
GET
request to url
provided the given headers
, where base_url
is so that base_url + tail == url
. Read moresource§fn post(
&mut self,
url: &str,
base_url: &str,
headers: impl IntoIterator<Item = impl AsRef<str>>,
body: PostBodyDataKind
) -> Result<PostResponse<Self::Headers, Self::ResponseBody, Self::PostBody>, Error>
fn post( &mut self, url: &str, base_url: &str, headers: impl IntoIterator<Item = impl AsRef<str>>, body: PostBodyDataKind ) -> Result<PostResponse<Self::Headers, Self::ResponseBody, Self::PostBody>, Error>
Initiate a
POST
request to url
providing with the given headers
, where base_url
is so that base_url + tail == url
. Read more