Cargo Features

[dependencies]
axum = { version = "0.7.7", default-features = false, features = ["form", "http1", "http2", "json", "macros", "matched-path", "multipart", "original-uri", "query", "tokio", "tower-log", "tracing", "ws"] }
default = form, http1, json, matched-path, original-uri, query, tokio, tower-log, tracing

These default features are set whenever axum is added without default-features = false somewhere in the dependency tree.

form default

Enables serde_urlencoded

http1 default

Enables http1 of hyper and optional hyper-util

hyper:

HTTP versions

Affects axum::serve, serve::serve, serve::Serve, serve::WithGracefulShutdown

http2

Enables http2 of hyper and optional hyper-util

Affects axum::serve, serve::serve, serve::Serve, serve::WithGracefulShutdown

json default

Enables serde_json and serde_path_to_error

macros

Enables axum-macros

optional dependencies

matched-path default
multipart

Enables multer

Affects extract::multipart

original-uri default

Affects request_parts::OriginalUri

query default

Enables serde_urlencoded

tokio default ws?

Enables hyper-util, macros, net and rt of tokio, make of tower

Affects extract::connect_info, handler::HandlerWithoutStateExt.into_make_service_with_connect_info, response::sse, service_ext::ServiceExt.into_make_service_with_connect_info, axum::serve, serve::serve, serve::Serve, serve::WithGracefulShutdown

tower-log default

Enables log of tower

tower:

FIXME: Use weak dependency once available (https://github.com/rust-lang/cargo/issues/8832)

tracing default

Enables tracing, tracing of axum-core

ws = tokio

Enables base64, hyper, sha1, and tokio-tungstenite

Affects extract::ws