Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

koa access request body

// 1) Setup Koa with the bodyparser middleware:
const Koa = require('koa');
const bodyParser = require('koa-bodyparser');
const app = new Koa();
app.use(bodyParser());

// 2) Then access the body in a controller via ctx.request.body: 
ctx.request.body
 
PREVIOUS NEXT
Tagged: #koa #access #request #body
ADD COMMENT
Topic
Name
3+8 =