I
I
ince2019-06-18 16:22:45
JavaScript
ince, 2019-06-18 16:22:45

How to send an array of objects?

There is an array with strignified objects (if you add an object to the array without strignification, then it is passed by reference, not by value) (in the specified example, there is only one object in the array).

["{\"status\":\" Учредитель/Собственник \",\"selfreg_org_name\":\" Ассоциация \\\"МСО\\\" \",\"qual_cert_direction\":\" Оценка недвижимости \",\"fullname\":\"0\",\"placeborn\":\"0\"}"]

I stringify and pass it in an Ajax request to the server and the server receives it in the form
{ '"{\\"status\\":\\" Учредитель/Собственник \\",\\"selfreg_org_name\\":\\" Ассоциация \\\\\\"МСО\\\\\\" \\",\\"qual_cert_direction\\":\\" Оценка недвижимости \\",\\"fullname\\":\\"0\\",\\"placeborn\\":\\"0\\"}"': ''}

How to pass in order to have a normal array at the output?
Or is it easier to add my objects not to an array, but to an object and pass it already?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Yarkov, 2019-06-18
@ince

Add to the array humanly, and then call on the entire array JSON.stringify.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question