Skip to main content

Module client

Module client 

Source

Structs§

Client
An HTTP client. Mirrors Go’s http.Client.
Transport
Default RoundTripper with per-host idle connection pooling. Port of Go’s http.Transport.

Enums§

RedirectPolicy
What a CheckRedirect policy decides for the next hop.

Traits§

RoundTripper
The low-level interface for executing a single HTTP request. Port of Go’s http.RoundTripper.

Functions§

get
Issue a GET using the default client. Port of Go’s http.Get.
head
Issue a HEAD using the default client.
post
Issue a POST using the default client. Port of Go’s http.Post.
post_form
Issue a POST form using the default client. Port of Go’s http.PostForm.
proxy_from_environment
A ProxyFn that reads the standard proxy environment variables, mirroring Go’s http.ProxyFromEnvironment:

Type Aliases§

CheckRedirect
A redirect policy. Called before each redirect is followed, with the request about to be made and via, the chain of requests already made (oldest first). Return RedirectPolicy::Follow to continue, RedirectPolicy::UseLastResponse to stop and return the last response, or an Err to abort the request with that error.
ProxyFn
Resolves the proxy to use for a request, or None for a direct connection. Port of Go’s Transport.Proxy func(*Request) (*url.URL, error).