1
votes

I'm looking at the github create comment API referenced here - https://developer.github.com/v3/pulls/comments/#create-a-comment

As per the API, if I do a GET at https://api.github.com/repos/govin/log4js-node/pulls/1/comments, I get an array of comments back.

However, when I do a POST at https://api.github.com/repos/govin/log4js-node/pulls/1/comments, the response is 404.

1

1 Answers

1
votes

Remember that:

  • a POST would require a proper authentication, as shown in this GitHub POST tutorial.
    No authentication means 404.

    curl --user "caspyin" --request POST --data {...}
    
  • you need to proper data mentioned in "Create a comment"

    {
      "body": "Nice change",
      "commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
      "path": "file1.txt",
      "position": 4
    }