I
I
Ilya2017-04-26 23:11:08
JSON
Ilya, 2017-04-26 23:11:08

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:
6ea2cfffcad045b98f8ba826a434e744.png
Here is the server code:
807298d72b0d41429210aa2d51364d2d.png
Here is the server response:
c8afc91ff1954eeb856d840f6d93c342.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2017-04-26
@BuriK666

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 question

Ask a Question

731 491 924 answers to any question