Cargo Features

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 js of getrandom, wasm_client of http-client

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.

once_cell curl-client h1-client? h1-client-no-tls? h1-client-rustls? hyper-client?

With default (std)

encoding_rs encoding

With default (alloc)

rustls_crate h1-client-rustls?

Enables default (logging) of rustls ^0.18

async-native-tls h1-client?

Enables default (runtime-async-std) of async-native-tls ^0.3.3

web-sys encoding wasm-client?

With TextDecoder