Cargo Features

[dependencies]
axum = { version = "0.7.1", 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

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

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

http2

Enables http2 of hyper

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

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, 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

tower-log default

Enables log of tower

tracing

Enables tracing of axum-core, tracing

ws = tokio

Enables base64, hyper, sha1, and tokio-tungstenite

Affects extract::ws

__private_docs

Required for intra-doc links to resolve correctly

Enables full of tower, tower-http