Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

I am trying to test post comment with the following URL

https://api.stackexchange.com/2.1/posts/10305691/comments/add?key=HIDDEN&access_token=HIDDEN&site=stackoverflow&preview=true&body=text123456789123&client_id=HIDDEN

Request Headers

Accept: */*
Content-Type: application/x-www-form-urlencoded; charset=UTF-8 
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8

I get the following response:

HTTP Error: 400 Bad Request

{
   "error_id": 500,
   "error_name": "internal_error",
   "error_message": "this error has been logged"
}

But the same POST request works when run from the console at the API doc.

So I used firebug to copy the full URL with parameters that was sent by the test console provided for /posts{id}/comments/add. I also copied the full list of request headers from firebug and tried using a REST client to test the same but I got the same error response as above.

Is there anything I am missing here?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

You should be POST'ing your parameters, form encoded, rather than putting them on the Url.

GET'ing should fail more gracefully than that though, I'll get a better error message in there in the next deploy.

share|improve this answer
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .