Skip to main content

r402_http/
lib.rs

1#![cfg_attr(docsrs, feature(doc_cfg))]
2
3//! HTTP transport layer for the x402 payment protocol.
4//!
5//! This crate provides HTTP middleware for both client and server roles
6//! in the x402 payment protocol.
7//!
8//! # Feature Flags
9//!
10//! - `server` — Axum/Tower middleware for payment gating
11//! - `client` — reqwest-middleware for automatic 402 handling
12//! - `telemetry` — Tracing instrumentation
13
14// `compact_str` is consumed by the server paygate's wire types; silence the
15// linter when the server feature is disabled.
16#[cfg(not(feature = "server"))]
17use compact_str as _;
18#[cfg(test)]
19use tokio as _;
20#[cfg(test)]
21use wiremock as _;
22
23#[cfg(feature = "server")]
24pub mod server;
25
26#[cfg(feature = "client")]
27pub mod client;