I am using flask oauthlib library . I am successfully getting get request however when I am trying update using post , I am getting back 404 not found error I am following the standard example they gave on the git page https://github.com/lepture/flask-oauthlib/blob/master/example/reddit.py
I am making post request by (continuing the example of the git page)
body = {
'kind' : 'self',
'sr' : 'dev_playspace',
'title' : "test playspace",
'text' : 'test text'
}
response = reddit.post('submit' , data=body);
return jsonify({'response' : response.data})
I have logged what library is actually sending. url : https://oauth.reddit.com/api/v1/submit
header : {'Content-Type': 'application/x-www-form-urlencoded', u'Authorization': u'Bearer Q7opsQbQ2ZJBruwC1zZATlLi-Fc'}
body looks like
sr=dev_playspace&kind=self&text=test+text&title=test+playspace
method : POST
Reddit api is responding with
{ "error": 404, "message": "Not Found" }
this is pretty confusing message. the subreddit is there (test subreddit /r/dev_playspace ) , and it seems like I am sending correct payload and url