Cargo Features

[dependencies]
surf = { version = "2.3.2", default-features = false, features = ["curl-client", "h1-client", "h1-client-no-tls", "h1-client-rustls", "hyper-client", "wasm-client", "default-client", "middleware-logger", "encoding"] }
default = curl-client, encoding, middleware-logger

when the default feature set is updated, verify that the --features flags in .github/workflows/ci.yaml are updated accordingly

curl-client default = default-client, once_cell

Enables curl_client of http-client

h1-client = async-native-tls, default-client, once_cell

Enables h1_client and native-tls of http-client

h1-client-no-tls = default-client, once_cell

Enables h1_client of http-client

h1-client-rustls = default-client, once_cell, rustls_crate

Enables h1_client and rustls of http-client

hyper-client = default-client, once_cell

Enables tokio02 of async-std, hyper_client of http-client

wasm-client = default-client, web-sys

Enables wasm_client of http-client and js of getrandom

getrandom:

Feature to enable JavaScript bindings on wasm*-unknown-unknown

default-client curl-client h1-client? h1-client-no-tls? h1-client-rustls? hyper-client? wasm-client?
middleware-logger default
encoding default = encoding_rs, web-sys

requires web-sys for TextDecoder on wasm

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.

once_cell curl-client h1-client? h1-client-no-tls? h1-client-rustls? hyper-client?
encoding_rs encoding
rustls_crate h1-client-rustls?

Enables rustls ^0.18

async-native-tls h1-client?

Enables async-native-tls ^0.3.3

web-sys encoding wasm-client?