Strapi: Cannot parse request body

Created on 22 Nov 2018  路  1Comment  路  Source: strapi/strapi

Informations

  • Node.js version: 10.11.0
  • npm version: 6.4.1
  • Strapi version: 3.0.0-alpha.14.5
  • Database: mongodb
  • Operating system: macOS Mojave

What is the current behavior?
Fetching the request params as ctx.request.body will return an Object (as far as I investigated, a Koa related one) that cannot be parsed like const { id } = body.posting_id or const { id } = body['posting_id']

Steps to reproduce the problem
Make a custom POST endpoint, pass some parameters.

What is the expected behavior?
The body should be parsed

Suggested solutions

help wanted

Most helpful comment

Where your body come from ?
Not sure to understand your issue.

ctx.request.body to get your params.
ctx.params to get url params
ctx.query to get url queries

>All comments

Where your body come from ?
Not sure to understand your issue.

ctx.request.body to get your params.
ctx.params to get url params
ctx.query to get url queries

Was this page helpful?
0 / 5 - 0 ratings

Related issues

profjefferson picture profjefferson  路  3Comments

OrestTs picture OrestTs  路  3Comments

GreenGremlin picture GreenGremlin  路  3Comments

dorelljames picture dorelljames  路  3Comments

peeomid picture peeomid  路  3Comments