K
K
kbc5902017-10-04 16:47:56
JavaScript
kbc590, 2017-10-04 16:47:56

How to increase POST request timeout in Ajax?

There is a simple POST request script that requests a simple php.

$.ajaxSetup({
    timeout: 300000
});
  $.ajax({			
    type: "POST",
    timeout: 300000,


Everything works if the pause is 1 second:
sleep(1); echo 'ok';

Stops working if there is a slip in php for more than a minute.
sleep(65); echo 'ok';

In the php settings, there is a long waiting interval.
If PHP is opened simply in the browser, everything works. Through the post, the Ajax request says Getway Timeout.

How to increase the timeout for a script?

The timeout setting in Ajax seems to be unresponsive.

The page with Ajax and the PHP script itself are nearby.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
profesor08, 2019-06-26
@Sector567

The browser does not understand your imports and exports. Deal with it and look for workarounds - webpack + babel.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question