curl - 如何使用curl PUT 到github API?

标签 curl github-api

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

及其多种组合。 我看过here , here ,和here其中sites

最佳答案

呵呵。看来发布问题是寻找答案的最佳方式。我花了几个小时在这上面。我会继续发布答案以节省其他人的时间。为了使用 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/

相关文章:

github - Github OAuth API 访问 token 的生命周期是多少

graphql - 使用 GitHub API v4 GraphQL 查找属于用户拥有的存储库的所有未解决问题

github - 通过id获取github用户名

php - libcurl 陷入 POLLIN 超时

python - curl 形式的 http post 方法的默认 header 内容类型是什么?

ssl - 为什么一个 curl 可以做 https 而另一个不能

javascript - Github API 列出来源存储库

rest - curl 没有使用 POST 指定 URL

javascript - 如何从 javascript 文件发送等效的 curl 命令?

github - 在 Github 中启用组织级别的分支保护规则