examples: Simplify Request and Response construction (#3653)

This commit is contained in:
tottoto
2026-02-11 09:08:22 +01:00
committed by GitHub
parent 57e2455905
commit 3f8956dcd0
8 changed files with 20 additions and 64 deletions
+2 -4
View File
@@ -89,7 +89,7 @@ mod tests {
let app = app();
let response = app
.oneshot(Request::builder().uri("/").body(Body::empty()).unwrap())
.oneshot(Request::get("/").body(Body::empty()).unwrap())
.await
.unwrap();
@@ -107,9 +107,7 @@ mod tests {
let response = app
.oneshot(
Request::builder()
.method(http::Method::POST)
.uri("/")
Request::post("/")
.header(
http::header::CONTENT_TYPE,
mime::APPLICATION_WWW_FORM_URLENCODED.as_ref(),