pub struct ClientBuilder { /* private fields */ }Expand description
Builder for Client.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new(base_url: impl Into<String>) -> Self
pub fn new(base_url: impl Into<String>) -> Self
Start building a client for the given server base URL, e.g.
http://127.0.0.1:8000. A configured server prefix (e.g.
/datapress) should be included here.
Sourcepub fn api_base(self, base: impl Into<String>) -> Self
pub fn api_base(self, base: impl Into<String>) -> Self
Override the versioned API mount path. Defaults to /api/v1; pass
/api to target the legacy unversioned alias.
Sourcepub fn admin_token(self, token: impl Into<String>) -> Self
pub fn admin_token(self, token: impl Into<String>) -> Self
Set the admin token sent as X-Admin-Token on mutating endpoints
(currently Client::reload).
Sourcepub fn bearer_token(self, token: impl Into<String>) -> Self
pub fn bearer_token(self, token: impl Into<String>) -> Self
Set an OAuth2 bearer token, attached as Authorization: Bearer …
to every request (for servers with auth enabled).
Sourcepub fn danger_accept_invalid_certs(self, accept: bool) -> Self
pub fn danger_accept_invalid_certs(self, accept: bool) -> Self
Accept invalid or untrusted TLS certificates.
Dangerous: disables certificate verification, leaving the connection open to man-in-the-middle attacks. Intended only for development against servers using self-signed certificates.
Sourcepub fn reqwest_builder(self, b: ClientBuilder) -> Self
pub fn reqwest_builder(self, b: ClientBuilder) -> Self
Provide a pre-configured reqwest::ClientBuilder to customise
the underlying HTTP client (proxies, TLS, pools, …).