Skip to main content

Crate tauri_plugin_http

Crate tauri_plugin_http 

Source
Expand description

Access the HTTP client written in Rust.

§Cargo features

§Reqwest feature forwards

These features forwards reqwest features:

  • http2 (enabled by default): Enables HTTP/2 support.
  • native-tls: Enables TLS functionality provided by native-tls, including ALPN.
  • native-tls-vendored: Enables the vendored feature of native-tls.
  • rustls-tls (enabled by default): Enables TLS functionality provided by rustls, verifying certificates with the platform verifier. Uses ring as the crypto provider, installed as the process default only if none is installed yet.
  • blocking: Provides the blocking client API.
  • charset (enabled by default): Improved support for decoding text.
  • cookies (enabled by default): Provides cookie session support.
  • gzip: Provides response body gzip decompression.
  • brotli: Provides response body brotli decompression.
  • zstd: Provides response body zstd decompression.
  • deflate: Provides response body deflate decompression.
  • json: Provides serialization and deserialization for JSON bodies.
  • multipart: Provides functionality for multipart forms.
  • stream: Adds support for futures::Stream.
  • socks: Provides SOCKS5 proxy support.
  • hickory-dns: Enables a Hickory DNS async resolver instead of the default threadpool using getaddrinfo.
  • system-proxy (enabled by default): Use Windows and macOS system proxy settings automatically.

§tauri-plugin-http features

  • tracing: Adds request, response, and cookie-store diagnostics through tracing.
  • unsafe-headers: Allows webview requests to send any headers.
  • dangerous-settings: Allows dangerous client settings such as accepting invalid certificates or hostnames.

§Security

The URL scope is checked on every hop of a redirect chain, not only on the URL requested by the frontend, so every redirect target must also be allowed by the scope. Otherwise a server on an allowed origin could redirect the request to any other origin - a localhost service, an internal host or a cloud metadata endpoint - and hand its response to the webview.

Enums§

Error
Errors that can happen while using the HTTP plugin.

Functions§

init

Type Aliases§

Result
Alias for a Result with the error type Error.