Answer the question
In order to leave comments, you need to log in
How to output nodejs post request body?
I am using Koa.
There are post requests that come from a third-party service. Send json.
All are perfectly processed, except for one request. For example, this is how I check the content of the request:
router.post('/myevent', async (ctx, next) => {
let body = ctx.request.body;
console.log(body);
ctx.body = body;
});
{ method: 'POST',
url: '/myevent',
header:
{ host: 'mydomain.ru',
connection: 'close',
'content-length': '84584',
'user-agent': 'GuzzleHttp/6.3.3 curl/7.65.0 PHP/7.3.9',
'content-type': 'application/json' } }
{ method: 'POST',
url: '/myevent',
header:
{ host: 'mydomain.ru',
connection: 'close',
'content-length': '6335',
'user-agent': 'GuzzleHttp/6.3.3 curl/7.65.0 PHP/7.3.9' } }
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question