在 Postman 中,我已经设置了一个简单的请求来访问 Azure DevOps API,使用 OAuth 2.0 安全性通过 Azure AD。Azure AD 应用程序已设置为具有用户同意访问 Azure DevOps API 的权限。
https://learn.microsoft.com/zh-cn/rest/api/azure/devops/core/projects/list?view=azure-devops-rest-5.1
我可以获取令牌,但是 Azure DevOps API 始终返回带有登录 HTML 的 203 状态码,而不是 JSON 响应。如果您有任何建议,我将不胜感激。
谢谢。
Postman 请求
谢谢。
Postman 请求
GET /[some_org]/_apis/projects?api=5.1 HTTP/1.1
Host: dev.azure.com
Authorization: Bearer [something]
User-Agent: PostmanRuntime/7.17.1
Accept: */*
Cache-Control: no-cache
Postman-Token: [something]
Accept-Encoding: gzip, deflate
Cookie: VstsSession=[something]
Referer: https://dev.azure.com/[some_org]/_apis/projects?api=5.1
Connection: keep-alive cache-control: no-cache