The /api/me.json
route only accepts GET requests:
s = client.get('http://www.reddit.com/api/me.json')
There is no POST route for that endpoint, so you'll get a 404 for that.
Also, if you need to pass modhash
to the server, do so in the data passed in the POST request; setting client.modhash
does not then pass that parameter to the server. You retrieve the modhash from your me.json
GET response:
r = client.get('http://www.reddit.com/api/me.json')
modhash = r.json()['modhash']
Note how the response from requests
has a .json()
method, there is no need to use the json
module yourself.
You then use the modhash
in POST request data:
client.post('http://www.reddit.com/api/updateapp', {'modhash': modhash, 'about_url': '...', ...})