bookclerk_tls::ureq
The ureq crate with the hosts' TLS: everything ureq exports, except
that the request functions (get, post, …), run and agent use
http_agent.
Import it in place of the crate (use bookclerk_tls::ureq;); call sites
then read like plain ureq. Build any other agent from
Agent::config_builder() with ureq_tls_config, never from
Agent::new_with_defaults(), which has no provider.
| Item | Kind | Summary |
|---|---|---|
agent |
function | The shared agent, in place of ureq::agent(), whose fresh default agent has no crypto provider. |
run |
function | Sends a prebuilt http::Request on the shared agent, in place of ureq::run, which uses a fresh default agent. |
get |
function | Starts a GET request. |
post |
function | Starts a POST request. |
put |
function | Starts a PUT request. |
delete |
function | Starts a DELETE request. |
head |
function | Starts a HEAD request. |
options |
function | Starts an OPTIONS request. |
connect |
function | Starts a CONNECT request. |
patch |
function | Starts a PATCH request. |
trace |
function | Starts a TRACE request. |
pub fn agent() -> Agent
The shared agent, in place of ureq::agent(), whose fresh default
agent has no crypto provider.
A clone of super::http_agent.
pub fn run(request: Request<impl AsSendBody>) -> Result<Response<Body>, Error>
Sends a prebuilt http::Request on the shared agent, in place of
ureq::run, which uses a fresh default agent.
request- The request to send.
The response.
Any Error the transfer raises.
pub fn get<T>(uri: T) -> RequestBuilder<WithoutBody>
where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
Starts a GET request.
uri- The request target, anything that converts to a URI.
A request builder on the shared agent.
pub fn post<T>(uri: T) -> RequestBuilder<WithBody>
where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
Starts a POST request.
uri- The request target, anything that converts to a URI.
A request builder on the shared agent.
pub fn put<T>(uri: T) -> RequestBuilder<WithBody>
where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
Starts a PUT request.
uri- The request target, anything that converts to a URI.
A request builder on the shared agent.
pub fn delete<T>(uri: T) -> RequestBuilder<WithoutBody>
where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
Starts a DELETE request.
uri- The request target, anything that converts to a URI.
A request builder on the shared agent.
pub fn head<T>(uri: T) -> RequestBuilder<WithoutBody>
where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
Starts a HEAD request.
uri- The request target, anything that converts to a URI.
A request builder on the shared agent.
pub fn options<T>(uri: T) -> RequestBuilder<WithoutBody>
where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
Starts an OPTIONS request.
uri- The request target, anything that converts to a URI.
A request builder on the shared agent.
pub fn connect<T>(uri: T) -> RequestBuilder<WithoutBody>
where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
Starts a CONNECT request.
uri- The request target, anything that converts to a URI.
A request builder on the shared agent.
pub fn patch<T>(uri: T) -> RequestBuilder<WithBody>
where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
Starts a PATCH request.
uri- The request target, anything that converts to a URI.
A request builder on the shared agent.
pub fn trace<T>(uri: T) -> RequestBuilder<WithoutBody>
where
Uri: TryFrom<T>,
<Uri as TryFrom<T>>::Error: Into<Error>,
Starts a TRACE request.
uri- The request target, anything that converts to a URI.
A request builder on the shared agent.
Generated from crates/bookclerk-tls at main · View as Markdown