Skip to content

Getting 400 for post request that receives JSON #2599

Answered by aliemjay
KisaragiEffective asked this question in Q&A
Discussion options

You must be logged in to vote

You can take a look at error::JsonPayloadError for the several reasons why Json extractor could fail.

JsonConfig can be used to customize error handling. Alternatively, You can handle errors manually in the handler by using Result<Json<D>, Error> as extractor instead of Json<D>.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@KisaragiEffective
Comment options

Answer selected by KisaragiEffective
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants