So, I have been developing a small flask app. I have been able to call the activate method from a web form, but i'm trying to post to it using the python requests library and keep getting 403 (there is no authentication being used).
But when I post to it using httplib2, all of a sudden it works. Is there something I'm missing here?
import httplib2
import requests
http = httplib2.Http()
content = http.request('http://127.0.0.1:5000/services/activate', method="POST")
print content
res = requests.post('http://127.0.0.1:5000/services/activate')
print res
Gives me the output:
({'status': '200', 'content-length': '20', 'server': 'Werkzeug/0.12.2 Python/2.7.12', 'date': 'Thu, 21 Dec 2017 05:55:20 GMT', 'access-control-allow-origin': '*', 'content-type': 'application/json'}, '{\n "status": "ok"\n}')
<Response [403]>