Answer the question
In order to leave comments, you need to log in
How to fix JSON parsing?
In general, the problem is as follows: data is received from the site to the server, it needs to be processed correctly. But I can’t parse them in any way, when I try to do this, an error immediately appears, but I can’t use this data in such a JSON format.
Can you suggest what can be done in this situation? Thanks in advance.
Here is the source file itself:
Here is the server code:
Here is the server response:
Answer the question
In order to leave comments, you need to log in
you already have req.body as an object and you don't need to parse it.
When you do JSON.parse(req.body) you get JSON.parse('[object Object]')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question