Answer the question
In order to leave comments, you need to log in
How to make a POST request on the server side using python?
Good evening. I'm trying to send a post request from my flask app to the rest api of the thumbor server. For some unknown reason, the request that I send from the flask application does not reach, and the application crashes with an exception:
requests.exceptions.ConnectionError: ('Connection aborted.', TimeoutError(110, 'Connection timed out'))
Tried to run a small server-side test script, everything works fine
endpoint = ' thumbor.sitename.com/image '
filename = './test.jpg'
with open(filename, 'rb') as media_file:
files = { 'media': media_file.read() }
response = requests.post(endpoint, files=files)
print(response, response.headers['location'])
The code which in the application practically does not differ from the test one. I also tried to send a request to another rest api, the result is about the same (falls with TimeoutError).
flask application, thumbor server and other api are on the same server in different docker containers.
Where can I find the cause of this problem?
EDIT:
I tried to run the test inside a docker container, the circle is closed, apparently it's all about the container settings. There is a suspicion that the whole thing is in closed ports, but what remains a mystery to me ...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question