From 16ea19d1950764b59daa42ab678c2b94b1978bb8 Mon Sep 17 00:00:00 2001 From: Altair-Bueno <67512202+Altair-Bueno@users.noreply.github.com> Date: Thu, 18 Aug 2022 20:48:39 +0200 Subject: [PATCH] examples(error-handling): Using POST instead of GET --- examples/error-handling/src/main.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/error-handling/src/main.rs b/examples/error-handling/src/main.rs index b4074dcc..17789d4b 100644 --- a/examples/error-handling/src/main.rs +++ b/examples/error-handling/src/main.rs @@ -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));