I make api call in another project, for example i got url http://localhost:5000/api/test
. After i do this link on my browser, the file have updated.
But i need make it on my python bot calls. So i try to use request.
import requests
requests.get('http://localhost:5000/api/test')
But then file who are in http://localhost:5000/api/test
was not updated.
I know its very complicated, but maybe anyone have idea? I don't need browser open i dont need any reaction, i just need with code open what url, and when correctly file will be updated.
UPDATED INFORMATION
then i click on browser the link http://localhost:5000/api/test
im getting {"success": true}
and the file was updated with now data.
Then i try with my code im getting
HTTP connection (1): localhost:5000 DEBUG:urllib3.connectionpool:http://localhost:5000 "GET /api/test HTTP/1.1" 302
219 DEBUG:urllib3.connectionpool:Resetting dropped connection: localhost DEBUG:urllib3.connectionpool:http://localhost:5000 "GET /login HTTP/1.1" 200 4470 200
But my file was not updated.
question from:
https://stackoverflow.com/questions/65936499/python-request-just-open-url-dont-need-show-or-open-in-browser 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…