Github REST API 不适用于自定义域
Github REST API is not working for custom domain
我正在尝试使用 Github API v3 来获取存储库中的所有文件和其他详细信息。但在我的组织中,我们有 github url 作为 https://github.abc.company_name.com. In this case I keep my REST url as https://abi.github.abc.company_name.com instead of https://abi.github.com。它不断返回 Could not get any response
.
我尝试了不同的身份验证。我无法获得任何 200 响应。
要访问 GitHub Enterprise 上的 APIs,您需要调用 APIs,如下所示:
https://hostname/api/v3/
因此,如果您的 GitHub url 是 https://github.abc.company_name.com
,那么您需要调用基数 url 的 API,如下所示:
https://github.abc.company_name.com/api/v3/
另请注意,您在进行 API 调用时需要添加基本身份验证 header,因为 API 会受到保护。
参考:GitHub
我正在尝试使用 Github API v3 来获取存储库中的所有文件和其他详细信息。但在我的组织中,我们有 github url 作为 https://github.abc.company_name.com. In this case I keep my REST url as https://abi.github.abc.company_name.com instead of https://abi.github.com。它不断返回 Could not get any response
.
我尝试了不同的身份验证。我无法获得任何 200 响应。
要访问 GitHub Enterprise 上的 APIs,您需要调用 APIs,如下所示:
https://hostname/api/v3/
因此,如果您的 GitHub url 是 https://github.abc.company_name.com
,那么您需要调用基数 url 的 API,如下所示:
https://github.abc.company_name.com/api/v3/
另请注意,您在进行 API 调用时需要添加基本身份验证 header,因为 API 会受到保护。
参考:GitHub