1
0
Fork 0
mirror of https://github.com/tokio-rs/axum.git synced 2025-04-16 02:30:56 +02:00

examples(error-handling): Using POST instead of GET

This commit is contained in:
Altair-Bueno 2022-08-18 20:48:39 +02:00
parent edd4e7b661
commit 16ea19d195

View file

@ -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));