mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-28 00:00:20 +02:00
examples(error-handling): Using POST instead of GET
This commit is contained in:
@@ -2,7 +2,7 @@ mod custom_extractor;
|
||||
mod derive_from_request;
|
||||
mod with_rejection;
|
||||
|
||||
use axum::{routing::get, Router, Server};
|
||||
use axum::{routing::post, Router};
|
||||
use std::net::SocketAddr;
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
@@ -17,9 +17,9 @@ async fn main() {
|
||||
|
||||
// Build our application with some routes
|
||||
let app = Router::new()
|
||||
.route("/withRejection", get(with_rejection::handler))
|
||||
.route("/customExtractor", get(custom_extractor::handler))
|
||||
.route("/deriveFromRequest", get(derive_from_request::handler));
|
||||
.route("/withRejection", post(with_rejection::handler))
|
||||
.route("/customExtractor", post(custom_extractor::handler))
|
||||
.route("/deriveFromRequest", post(derive_from_request::handler));
|
||||
|
||||
// Run our application
|
||||
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
||||
|
||||
Reference in New Issue
Block a user