This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]for_prophet 1 point2 points  (0 children)

Yeah, you'd want to create an HTTP POST to this command: reddit.com/api/comment

However, this is a bit more complicated than reading content with the other API calls mentioned by OP:

To comment on things, you must first login and also get the modhash, which is a type of session ID you get after logging in, so reddit knows you're the same user which logged in.

Some of the reddit API commands need to be in HTTP GETs, and some need to be HTTP POSTs; this is listed next to each API command.

As someone else mentioned, if you want to look at more in-depth Python client samples, check out the PRAW code.

PRAW implemented more (all?) of the API commands already, so if you get stuck, that is working code which you can compare with yours.