1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
//! HTTP types, request/response handling, and protocol utilities.
//!
//! This module provides the core HTTP abstractions used throughout Salvo:
//!
//! # Key Types
//!
//! | Type | Description |
//! |------|-------------|
//! | [`Request`] | Incoming HTTP request with body, headers, and metadata |
//! | [`Response`] | Outgoing HTTP response builder |
//! | [`ReqBody`] | Request body type supporting streaming |
//! | [`ResBody`] | Response body type with multiple representations |
//! | [`StatusError`] | HTTP error with status code and message |
//!
//! # Request Processing
//!
//! The [`Request`] type provides methods for:
//! - Accessing headers, method, URI, and query parameters
//! - Parsing body as JSON, form data, or multipart
//! - Extracting path parameters from the route
//! - Accessing cookies (with `cookie` feature)
//!
//! # Response Building
//!
//! The [`Response`] type supports:
//! - Setting status codes and headers
//! - Rendering various content types (JSON, HTML, text, etc.)
//! - Streaming responses
//! - Setting cookies
//!
//! # Error Handling
//!
//! Use [`StatusError`] for HTTP error responses:
//!
//! ```ignore
//! use salvo_core::http::StatusError;
//!
//! // Create common errors
//! let not_found = StatusError::not_found();
//! let bad_request = StatusError::bad_request().brief("Invalid input");
//!
//! // Custom error with details
//! let error = StatusError::internal_server_error()
//! .brief("Database connection failed")
//! .detail("Connection timeout after 30 seconds");
//! ```
//!
//! # Re-exports
//!
//! This module re-exports types from the `http` and `headers` crates for convenience:
//! - [`Method`], [`StatusCode`], [`HeaderMap`], [`HeaderName`], [`HeaderValue`]
//! - [`Version`], [`Mime`], and various header-related types
cfg_feature!
pub use ;
pub use headers;
pub use Method;
pub use ;
pub use HttpRange;
pub use Request;
pub use ;
pub use Version;
pub use Mime;
pub use Response;