how pass data from body in koa js

JavaScript
 ctx.throw(400, 'Grant: mount session middleware first')
if (ctx.method === 'POST' && !ctx.request.body) {
 ctx.throw(400, 'Grant: mount body parser middleware first')
  ctx.session.grant.override = override
 if (Object.keys(ctx.request.body || {}).length) {
  ctx.session.grant.dynamic = ctx.request.body
router.post("/api/comments", async ctx => {
  ctx.session.comments = ctx.session.comments || [];

  if (!ctx.request.body["comment"]) {
   throw Boom.badData("Empty comments not allowed");
  }

  const comment = {
   date: new Date(),
   comment: ctx.request.body["comment"],
  };
  ctx.session.comments.push(comment);
  ctx.status = 201;
  ctx.body = comment;
 });
httpRouter.post('/syncCallNative/*', async (ctx, next) => {
 const idx = syncCallNativeIndex++
 const payload = ctx.request.body
 const channelId = ctx.params[0]
 const device = Device.getDevice(channelId)
 const instanceId = payload.params.args[0]
 if (device) {
  const terminal = new SyncTerminal()
  let data
  terminal.channelId = channelId
  syncNativeHub.join(terminal, false)
  payload.params.syncId = 1000 + idx
  payload.id = 1000 + idx
  if (Config.get('ACTIVE_INSTANCEID') !== instanceId) {
   data = [{}]
  } else {
   data = await terminal.send(payload)
  }
  ctx.response.status = 200
  ctx.type = 'application/json'
  ctx.response.body = JSON.stringify(data)
 } else {
  ctx.response.status = 500
 }
 await next()
})
httpRouter.post('/syncCallJS/*', async (ctx, next) => {
 const idx = syncCallJSIndex++
 const channelId = ctx.params[0]
 const payload = ctx.request.body
 const device = Device.getDevice(channelId)
 if (device) {
  const terminal = new SyncTerminal()
  let data
  terminal.channelId = channelId
  syncV8Hub.join(terminal, false)
  payload.params.syncId = 100000 + idx
  payload.id = 100000 + idx
  data = await terminal.send(payload)
  ctx.response.status = 200
  ctx.type = 'application/json'
  ctx.response.body = JSON.stringify(data.ret)
 } else {
  ctx.response.status = 500
 }
 await next()
})

Source

Also in JavaScript: