我想通过postman使用github api在我的github帐户上创建一个文件。
在github账户上创建文件的github api:
PUT /repos/:owner/:repo/contents/:path 谁能告诉我如何在邮递员中使用这个api。
我有我的公共github帐户:https://github.com/ritzygithub/myfirstRepo
在邮递员标题中我设置了
Authorization type to OAuth 2
Authorization : token <token>
PUT request with url: https://api.github.com/repos/ritzygithub/myfirstRepo/

你能帮我解决这个问题吗
发布于 2018-10-26 14:23:36
我刚刚想通了..在这里张贴我的答案,这样如果有人面临同样的问题,这可以帮助他们。
在postman中,使用以下URL设置为PUT请求
https://api.github.com/repos/YourUsername/YourRepo/contents/file.txt添加正文:
{
"message": "my commit message",
"committer": {
"name": "My name",
"email": "my email"
},
"content": "base64encoded"
}Header: Content-Type :应用/json授权: token
请参阅下面的截图:

希望这能有所帮助。谢谢
https://stackoverflow.com/questions/53001974
复制相似问题