2015-09-06 71 views
2

有很多github API的例子。但是,我一直無法辨別如何使用cURL和API將其放到github上。特別是,我試圖自動關注用戶。 我已經試過:如何使用curl放入github API?

curl --user "myusername:mypassword" -X PUT "/myusername/following/personIdliketofollow" https://api.github.com/ 

還有:

curl --user "myusername:mypassword" -X PUT "" https://api.github.com/myusername/following/personIdliketofollow 

及其多種組合。 我看了herehereheresites

回答

2

Doh。似乎發佈問題是找到答案的最佳方式。我花了幾個小時。我會繼續發佈答案,以節省其他時間。爲了使用cURL to GUT來跟蹤另一個用戶,語法是:

curl --user "username:password" -X PUT -d "" https://api.github.com/user/following/personYoudLiketoFollow