Skip to content

Usage of Vec in request #2572

Closed Answered by SergioBenitez
averyoldman asked this question in Questions
Discussion options

You must be logged in to vote

Yes, but you need to specify the format. If it's JSON, do:

#[patch("/rapport", data = "<rapport>")]
fn update_rapport(conn: &State<Connection>, rapport: Json<Vec<Rapport>>) { .. }

If it's a form, do:

#[patch("/rapport", data = "<rapport>")]
fn update_rapport(conn: &State<Connection>, rapport: Form<Vec<Rapport>>) { .. }

And so on.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SergioBenitez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants