There is JSON, about 45 kilobytes. This is a list of objects:

{ name: 'My Name', add: true, type: 'group' } 

This list is transmitted by ajax to the server. Then magic begins - the last object in the list does not have a type field. Right before sending this field is.

What could be the problem?

  • In the limits of the web server on the post. Do you have nginx, apache? And, the request is cut off or only one field is missing, and closing} in place? - AK
  • Apache But the limit is still very far away, I successfully accept packages of much larger volume. - Ilya Bizunov
  • @ Ilya Bizunov can be the matter of the transfer method? Are you using gett? Try to replace the post. - Edward
  • I send it with POST, of course. - Ilya Bizunov
  • cycle generate? - etki

1 answer 1

I once asked a question here. Why is a lot of variables created by passing json via pjax post?

Actually, it is also related to your question. If you have a bunch of variables, then it is logical that the limit on their number is played by the server. And then you can increase max_input_vars in the php.ini settings. But it is better to make them in the form of a single variable, first making a JSON object and then send using JSON.stringify .

Like that:

 $.ajax({ type: 'POST', url: path, data: { jsonData: JSON.stringify(data) // <--- ключевой момент } success: function(response){ // ... } }); 

The server will be like this:

 json_decode($_POST['jsonData']);