pksunkara / octonode

github api v3 in nodejs
MIT License
1.19k stars 237 forks source link

Projects API broken due to header requirement #343

Closed PerfectedApp closed 3 years ago

PerfectedApp commented 4 years ago

From GitHub page regarding Project API:

Note: The Projects API is currently available for developers to preview. During the preview period, the API may change without advance notice. Please see the blog post for full details. To access the API during the preview period, you must provide a custom media type in the Accept header:

application/vnd.github.inertia-preview+json

Source: https://developer.github.com/v3/projects/

Current error message from calling project API:

null 415 {
  message: “If you would like to help us test the Projects API during its preview period, you must specify a custom media type in the ‘Accept’ header. Please see the docs for full details.“,
  documentation_url: ‘https://developer.github.com/v3/projects/#list-repository-projects’
} {
  date: ‘Wed, 29 Apr 2020 15:07:49 GMT’,
  ‘content-type’: ‘application/json; charset=utf-8’,
  ‘content-length’: ‘279’,
  connection: ‘close’,
  server: ‘GitHub.com’,
  status: ‘415 Unsupported Media Type’,
  ‘x-ratelimit-limit’: ‘5000’,
  ‘x-ratelimit-remaining’: ‘4969’,
  ‘x-ratelimit-reset’: ‘1588173005’,
  ‘x-oauth-scopes’: ‘admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, read:packages, repo, user, workflow, write:discussion, write:packages’,
  ‘x-accepted-oauth-scopes’: ‘repo’,
  ‘x-github-media-type’: ‘github.v3; format=json’,
  ‘access-control-expose-headers’: ‘ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset’,
  ‘access-control-allow-origin’: ‘*’,
  ‘strict-transport-security’: ‘max-age=31536000; includeSubdomains; preload’,
  ‘x-frame-options’: ‘deny’,
  ‘x-content-type-options’: ‘nosniff’,
  ‘x-xss-protection’: ‘1; mode=block’,
  ‘referrer-policy’: ‘origin-when-cross-origin, strict-origin-when-cross-origin’,
  ‘content-security-policy’: “default-src ‘none’“,
  vary: ‘Accept-Encoding, Accept, X-Requested-With’,
  ‘x-github-request-id’: ‘C19******9845’
}