Hi. I might be misunderstanding the purpose of the bodyparser. I have an AWS SNS topic posting to my endpoint JSON data in typeof string and with 'content-type': 'text/plain; charset=UTF-8'. I get the same string after the bodyparser as in the payload (ctx.request.body === ctx.request.rawBody). Just trying to understand the following:
What's the purpose of this bodyparser when the content-type': 'text/plain'? What exactly it's supposed to do?
Is there a better way to parse the text payload into JSON object instead of me doing JSON.parse(). I can't seem to get the bodyparser do it for me.
Hi. I might be misunderstanding the purpose of the bodyparser. I have an AWS SNS topic posting to my endpoint JSON data in typeof string and with
'content-type': 'text/plain; charset=UTF-8'
. I get the same string after the bodyparser as in the payload (ctx.request.body === ctx.request.rawBody
). Just trying to understand the following:content-type': 'text/plain'
? What exactly it's supposed to do?JSON.parse()
. I can't seem to get the bodyparser do it for me.Thank you.
node@9.3.0 koa@2.0.43 koa-bodyparser@4.2.0