Does the bitry API support CORS?

I've seen in my documentation that CORS is supported. But my attempts to make a request from JavaScript are unsuccessful.

Requesting this url:

I am getting standard error:

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '' is therefore not allowed access.


UPD: bitly documentation -


source to share

1 answer

If anyone else has this problem. The reason this happens is because the default (preflight) response from the bit does not include the "Access-Control-Allow-Origin" header.

to get around this i used XMLHttpRequest which doesn't send preview.

let xhr = new XMLHttpRequest();
let url = '''GET', url);
xhr.onreadystatechange = function() {
   if(xhr.readyState === 4) {
     if(xhr.status===200) {
     } else {


This is actually mentioned in the bitly documentation



All Articles