forked from talklittle/reddit-is-fun
-
Notifications
You must be signed in to change notification settings - Fork 30
Login
talklittle edited this page Sep 13, 2010
·
15 revisions
• To login you need to POST to http://www.reddit.com/api/login/
• user=[username]
• passwd=[plaintext password]
• It always returns HTTP code 200 OK
• Need to read message content (single line JSON format) and if it contains string “WRONG_PASSWORD” then login failure.
POST /api/login/talklittle_test HTTP/1.1
Host: www.reddit.com
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Content-Length: 48
user=api_type=json&talklittle_test&passwd=hunter2
returns JSON including the cookie and modhash. (important to use api_type=json)
{"json": {"errors": [], “data”: {"modhash": “2y30c3rdelc449b75fc909f81d725e327ae095eda788412345”, “cookie”: “5998378,2009-09-06T19:45:42,83d5373c483422b549f9ca7b592c4ecf0dc29438”}}}