gnuns / allOrigins

:alien: Pull content from any page as JSON via API

Home Page:https://allorigins.win/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to pass headers

Tim-Ganther opened this issue · comments

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?