RapidAPI

The RapidAPI Developer Hub

Welcome to the RapidAPI developer hub. You'll find comprehensive guides and documentation to help you start working with RapidAPI as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    Documentation
Ask A Question

Questions

Imgur API failing on post from Chrome extension

Posted by Jason 2 months ago

I've been successfully using the Imgur API for a while now, but recently this error is occurring:

Failed to load https://imgur-apiv3.p.mashape.com/3/image: The 'Access-Control-Allow-Origin' header contains the invalid value ''. Origin 'chrome-extension://ajdcpfdbildfaahcgabgjhojmbalcnff' is therefore not allowed access.

The code I am using is...

$.ajax({
    url: "https://imgur-apiv3.p.mashape.com/3/image",
    type: "POST",
    timeout: 45000,
    data: {type: "base64", image: base64Data},
    beforeSend : function(xhr) {
        xhr.setRequestHeader("X-Mashape-Key", "hiddenforprivacy");
        xhr.setRequestHeader("Authorization", "Client-ID " + "hiddenforprivacy");
    }

It seems your technicians or server host has changed the "Access-Control-Allow-Origin" value. The solution would be to set it to *

Loading comments...