Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to pass headers #61

Open
Tim-Ganther opened this issue Nov 3, 2020 · 0 comments
Open

How to pass headers #61

Tim-Ganther opened this issue Nov 3, 2020 · 0 comments

Comments

@Tim-Ganther
Copy link

I have to provide a special header in order to fetch. I am trying the following:

let response = await fetch( `https://api.allorigins.win/get?url=${encodeURIComponent('https://platform.tier-services.io/v1/vehicle?zoneId=BERLIN')}`, {
    headers: {
      "X-Api-Key": "MY_KEY"
    }
  });

but I always receive:
Request header field x-api-key is not allowed by Access-Control-Allow-Headers in preflight response.

Any ideas how to correctly provide the headers?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants