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
@@ -19,7 +19,7 @@ mod unix {
use axum::{
body::Body,
extract::connect_info::{self, ConnectInfo},
http::{Method, Request, StatusCode},
http::{Request, StatusCode},
routing::get,
serve::IncomingStream,
Router,
@@ -63,9 +63,7 @@ mod unix {
}
});
let request = Request::builder()
.method(Method::GET)
.uri("http://uri-doesnt-matter.com")
let request = Request::get("http://uri-doesnt-matter.com")
.body(Body::empty())
.unwrap();