Documentation
Request
The first parameter of the handler function is Request
.
Request is a core Fastify object containing the following fields:
query
- the parsed querystringbody
- the bodyparams
- the params matching the URLheaders
- the headersreq
- the incoming HTTP request from Node corelog
- the logger instance of the incoming request
fastify.post('/:params', options, function (request, reply) {
console.log(request.body)
console.log(request.query)
console.log(request.params)
console.log(request.headers)
console.log(request.req)
request.log.info('some info')
})