Replies: 1 comment 5 replies
-
Looks like you are confusing JSON input with Form input here: #[post("/time", format="json", data="<user>")]
fn post_time(user: Json<Time>) -> String {
String::from(format!(
"Created user: {}", user.commence_time))
} You should use #[post("/time", data="<user>")]
fn post_time(user: Form<Time>) -> String {
format!("Created user: {}", user.commence_time)
} |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello i have a form with a dropdown select where i chose a date, when a date is chosen i would like to have the chosen value to a rust variable.
main.rs:
index.html.tera
if i submit i get this error
No matching routes for POST /time application/x-www-form-urlencoded.
Beta Was this translation helpful? Give feedback.
All reactions