D
D
Dmitry-H872019-06-20 13:50:04
JavaScript
Dmitry-H87, 2019-06-20 13:50:04

How to increase the timeout for a post request?

Good afternoon. It so happened that you need to increase the timeout for the request. It seemed to me that this should be quite simple and solved by setting some one parameter on the request, but it seems that the issue is not so easily solved.
The situation is the following. There is a client on angular 5, which, using HttpClient, makes a post request to the node server, requests on which are processed by express. The server, in turn, accesses the database, receives a response and sends it to the client. As it turned out, the default timeout for a post-request is 120 seconds, after it ends, an error always occurs on the client, even if the request to the database has not yet been completed. Is there a way to increase this timeout to 300 seconds for example? I actively googled this topic, but I didn’t find anything effective, the timeout can only be reduced and give an error earlier, but it didn’t work out.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Gene Hagmt, 2019-06-20
@g_hagmt

If you have Apache, maybe this will help?
httpd.apache.org/docs/2.0/mod/core.html#timeout
Must be changed in the web server config.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question