小编Cal*_*oju的帖子

获取 GitHub Branch 保护返回“404 Not Found”

我尝试使用curl / Postman 获取分支策略,但是我不断收到错误“404 Not Found”。 在此输入图像描述

根据文档(https://docs.github.com/en/rest/reference/repos#get-branch-protection),我似乎使用了正确的 API Uri。请参阅下面使用的命令。Ps:Auth Token已被验证。

对于卷曲:

curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/{owner}/{repo}/branches/{branch}/protection
Run Code Online (Sandbox Code Playgroud)

邮差:

https://api.github.com/repos/{owner}/{repo}/branches/{branch}/protection
Run Code Online (Sandbox Code Playgroud)

我需要 API 调用来返回分支保护。谢谢!

api rest curl github postman

3
推荐指数
1
解决办法
1331
查看次数

标签 统计

api ×1

curl ×1

github ×1

postman ×1

rest ×1