apicase/core

CORS Support?

Closed this issue · 3 comments

Is it possible to call the api from external server? I got the same origin error when trying external url.

Request mode is "same-origin" but the URL's origin is not same as the request origin

Do you use fetch adapter? You can use

  doRequest({
    adapter: fetch,
    url: 'smth',
+   mode: 'cors'
  })

Like native fetch works: https://developer.mozilla.org/en-US/docs/Web/API/Request/mode

It works now. Thank you.

No problem ;)