Skip to content

How can i use content negotiation when validate data? #1269

Answered by RomainLanz
nandordudas asked this question in Help
Discussion options

You must be logged in to vote

Hey @nandordudas! 👋

If you want to have JSON API format back you need to send the Accept header everytime.
You can also force the Accept in your configuration config/app.ts.

Note that you are using the validator wrong.
You shouldn't pass an anonymous class.

https://preview.adonisjs.com/guides/validator/usage

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by nandordudas
Comment options

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