M
M
McThinker2020-05-26 21:07:02
PHP
McThinker, 2020-05-26 21:07:02

Why does not the full array come to the server?

Hello everyone, I'm sending an array with Ajax, but part of the array is lost along the way.

Here is the console before sending
5ecd59626296f940766919.png

. Here is the apishka working in echo mode. Comes without transfer
5ecd598f32886671015001.png

Here is the code before sending:

let dataFlight = {};
  dataFlight['flights'] = flights;
  dataFlight['csrf_ws_name'] = $('.csrf').val();
  console.log(dataFlight)
  $.ajax({
    url: "/api/set_api_flights",
    type: "POST",
    dataType: "json",
    data: dataFlight,
    success: function (res) {
     ///
    }
  });


How so?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
rijk, 2020-05-26
@McThinker

Before sending, convert the value to json string JSON.stringify(), on the server, convert back

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question