When calling github api I am getting code 400, but every thing seems to be fine and even working from curl #120151
Replies: 2 comments 2 replies
-
Are you have the api repository of you haven't check you access and check if the port is closed? |
Beta Was this translation helpful? Give feedback.
-
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
Select Topic Area
Question
Body
I am generating an installation access code using the api (with app id, installation id and private key) and I am getting this:
{
token: 'nnnn',
permission: {
....
pull_requests: 'write',
},
repository_selection: 'all'
}
then I am trying to use that token:
axios.get('https://api.github.com/repos/owner/repo/pulls/12')
passando os headers:
Authorization: 'Bearer nnnn'
Accept: 'application/vnd.github+json'
X-GitHub-Api-Version: '2022-11-28'
and getting a 400 http code
Note: proxy has been set when creating the axios instance:
proxy: {
host: 'bbb',
port: 1111,
protocol: 'http'
}
This is the request been sent:
{
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
adapter: [ 'xhr', 'http' ],
transformRequest: [ [Function: transformRequest] ],
transformResponse: [ [Function: transformResponse] ],
timeout: 0,
xsrfCookieName: 'XSRF-TOKEN',
xsrfHeaderName: 'X-XSRF-TOKEN',
maxContentLength: -1,
maxBodyLength: -1,
env: {
FormData: [Function: FormData] {
LINE_BREAK: '\r\n',
DEFAULT_CONTENT_TYPE: 'application/octet-stream'
},
Blob: [class Blob]
},
validateStatus: [Function: validateStatus],
headers: Object [AxiosHeaders] {
Accept: 'application/vnd.github+json',
'Content-Type': 'application/json',
Authorization: 'xxxxx',
'X-GitHub-Api-Version': '2022-11-28'
},
proxy: { host: 'webproxy-inet.ms.com', port: 8080, protocol: 'http' },
method: 'get',
url: 'https://api.github.com/repos/b/c/pulls/418'
}
What is wrong??
Beta Was this translation helpful? Give feedback.
All reactions