We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I think having some more accessors in the Request might be pretty handy, as an example:
Request
fastify.post('/', function (req, reply) { switch(req.type(['json', 'html'])) { case 'json': reply.type('application/json').send({hello: 'world'}) break case 'html': reply.type('text/html').send('<b>hello, world!</b>') break default: reply.send(Boom.notAcceptable('unacceptable')) break } })
The text was updated successfully, but these errors were encountered:
Nice!
Should we cache the Accepts object for multiple queries on the sample Request instance?
Sorry, something went wrong.
Yes. I would store it with a symbol.
allevo
No branches or pull requests
I think having some more accessors in the
Request
might be pretty handy, as an example:The text was updated successfully, but these errors were encountered: