How to send data to endpoint when running tests? #2233
Answered
by
Glitchy-Tozier
Glitchy-Tozier
asked this question in
Questions
-
I've started working on automated tests. However, when trying to send data to an enpoint, I couldn't find a way to do so without rust complaining. How can I send Endpoint: #[post("/create", format = "json", data = "<setup_data>", rank = 3)]
fn create_poll(conn: DbConn, setup_data: Json<SetupData>) -> ApiResult<String> {
...
} |
Beta Was this translation helpful? Give feedback.
Answered by
Glitchy-Tozier
Jun 18, 2022
Replies: 1 comment
-
Using |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Glitchy-Tozier
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using
.json(data)
instead of.body(Json(data))
fixed the issue.