Skip to main content

recommended_client

Function recommended_client 

Source
pub fn recommended_client() -> Result<Client, Error>
Available on crate feature client only.
Expand description

Builds a reqwest::Client pre-configured for safe NodeInfo resolution.

The returned client uses a strict redirect policy — at most two redirects, all to the same origin — which matches Mastodon’s defaults and neutralises cross-origin redirect attacks on the endpoint.

§Errors

Returns Error::Http if the underlying TLS stack cannot be initialised.