Async http request for Google App Engine Python

Does anyone know how to make an HTTP request from Google App Engine without waiting for a response? It should be like push data with http without delay for a response.

+4
source share
4 answers

I think this section of the AppEngine docs is what you are looking for.

+3
source

Use the task. If you just click on the data, it makes no sense to wait for a response.

+2
source

What you can do is put a task with any received data in the request handler (using the deferred library ). Once the task is successfully completed, you can return the answer “200 OK” and be ready for the next press.

+1
source

I did this earlier by setting URLFetch and setting a very low value for the deadline parameter. I set 0.1 as my value, so 100ms. You need to wrap URLFetch in try / catch, as the request will time out.

0
source

Source: https://habr.com/ru/post/1341170/


All Articles