@@ -83,9 +83,9 @@ impl Response {
83
83
/// ```
84
84
/// # fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
85
85
/// #
86
- /// use http_types::{Url, Method, Request };
86
+ /// use http_types::{Url, Method, Response, StatusCode };
87
87
///
88
- /// let mut req = Request ::new(Method::Get, Url::parse("https://example.com")? );
88
+ /// let mut req = Response ::new(StatusCode::Ok );
89
89
/// req.insert_header("Content-Type", "text/plain")?;
90
90
/// #
91
91
/// # Ok(()) }
@@ -145,7 +145,7 @@ impl Response {
145
145
}
146
146
}
147
147
148
- /// Replace the request body with a new body, returning the old body.
148
+ /// Replace the response body with a new body, returning the old body.
149
149
///
150
150
/// # Examples
151
151
///
@@ -154,9 +154,9 @@ impl Response {
154
154
/// # fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
155
155
/// # async_std::task::block_on(async {
156
156
/// #
157
- /// use http_types::{Body, Url, Method, Request };
157
+ /// use http_types::{Body, Url, Method, Response, StatusCode };
158
158
///
159
- /// let mut req = Request ::new(Method::Get, Url::parse("https://example.com")? );
159
+ /// let mut req = Response ::new(StatusCode::Ok );
160
160
/// req.set_body("Hello, Nori!");
161
161
///
162
162
/// let mut body: Body = req.replace_body("Hello, Chashu");
@@ -181,9 +181,9 @@ impl Response {
181
181
/// # fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
182
182
/// # async_std::task::block_on(async {
183
183
/// #
184
- /// use http_types::{Body, Url, Method, Request };
184
+ /// use http_types::{Body, Url, Method, Response, StatusCode };
185
185
///
186
- /// let mut req = Request ::new(Method::Get, Url::parse("https://example.com")? );
186
+ /// let mut req = Response ::new(StatusCode::Ok );
187
187
/// req.set_body("Hello, Nori!");
188
188
///
189
189
/// let mut body = "Hello, Chashu!".into();
@@ -199,7 +199,7 @@ impl Response {
199
199
mem:: swap ( & mut self . body , body) ;
200
200
}
201
201
202
- /// Take the request body, replacing it with an empty body.
202
+ /// Take the response body, replacing it with an empty body.
203
203
///
204
204
/// # Examples
205
205
///
@@ -208,9 +208,9 @@ impl Response {
208
208
/// # fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
209
209
/// # async_std::task::block_on(async {
210
210
/// #
211
- /// use http_types::{Body, Url, Method, Request };
211
+ /// use http_types::{Body, Url, Method, Response, StatusCode };
212
212
///
213
- /// let mut req = Request ::new(Method::Get, Url::parse("https://example.com")? );
213
+ /// let mut req = Response ::new(StatusCode::Ok );
214
214
/// req.set_body("Hello, Nori!");
215
215
/// let mut body: Body = req.take_body();
216
216
///
0 commit comments