I'm trying to make a GET request to the url "https://public-api.wordpress.com/wpcom/v2/work-with-us" with special header 'X-future' and value 'automattician'. However, I get the error that this header is not allowed in preflight response:
"Request header field x-future is not allowed by Access-Control-Allow-Headers in preflight response."
From searching around, it seems that this is a CORS issue and I have to add the header from the server side. However, I don't have access to the server.
Is this problem not solvable or am I missing something? Here's what I wrote in code pen to test:
let url = 'https://public-api.wordpress.com/wpcom/v2/work-with-us';
const options = {
method: 'GET', //default
headers: {'X-future': 'automattician'}
};
fetch(url, options)
.then(blob => blob.json())
.then(data => console.log(data));