I’m attempting to use the reddit API to make posts, but the server is returning 500 errors.
For example, I tried posting to this URL with my cookie set:
http://www.reddit.com/api/submit?title=testtitle&sr=compsci&uh=<modhash_goes_here>&text=testtext&kind=self
And my Chrome Dev Tools prints the following error:
POST <my long URL goes here> 500 (Internal Server Error)
I read somewhere on StackOverflow that you need both the modhash and the cookie, so that’s what I’m using. I tried without the modhash, and I tried with the superfluous “r=subreddit” parameter listed on Apigee. Neither helped.
Why would I be getting a 500 error?
You’re not supposed to POST data in the URL; you set the data in the POST object, and the POST that…. Which makes sense, because you POST things like passwords. For example (using jQuery):
URLs just happen to work for some reddit API calls because they implemented them on GET in addition to POST.