K
K
komarevtsev2016-05-28 17:02:09
Node.js
komarevtsev, 2016-05-28 17:02:09

Is the data coming in the wrong format?

Data leaves the server in JSON format like this: {"status":"OK","offer_id":"1276418322"}
and comes like this: "{\"status\":\"OK\",\ "offer_id\":\"1276497776\"}"
That is, you need to do JSON.parse 2 times in a row.
Why is this happening?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2016-05-28
@komarevtsev

The node itself serializes objects. Obviously, you first serialize with your hands, then the node does it. Well, in the browser, of course, you have to deserialize twice.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question