In koa, we use to ctx.params
obtain the request parameters in the url path, use to ctx.query
obtain the query string parameters behind?, and use to ctx.headers
obtain headers
because it is configured in app.js, which koa-bodyparser
can be used to ctx.request.body
obtain the json parameters passed by the post.
Make a breakpoint and send the request with postman.
Result: