github上有很多API示例。但是,我无法辨别如何使用 cURL 和 API 将 PUT 到 github。特别是,我正在尝试自动关注用户。 我尝试过:
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
最佳答案
呵呵。看来发布问题是寻找答案的最佳方式。我花了几个小时在这上面。我会继续发布答案以节省其他人的时间。为了使用 cURL PUT 到 Github 来关注另一个用户,语法是:
curl --user "username:password" -X PUT -d "" https://api.github.com/user/following/personYoudLiketoFollow
关于curl - 如何使用curl PUT 到github API?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32418815/