Uncategorized

imgur down imgur http error 429

Kworld Trend / imgur down imgur http error 429

imgur down imgur http error 429

Here’s how to fix imgur not working. This imgur error 429 error is searched as http error 429 imgur and imgur images not loading.

Watch this video, or read the below:

Problem

I’m trying to upload a image using html form with imgur api(react).

I’ve selected OAuth 2 authorization with a callback URL when registering api.

The problem is that api is wont work with error 429 (sometimes net::ERR_HTTP2_PROTOCOL_ERROR).

This is the code

const imageUpload = (e) => {
    console.log("called");
    var fileIn = e.target;
    var file = fileIn.files[0];
    if (file && file.size < 5e6) {
        const formData = new FormData();

        formData.append("image", file);
        fetch("https://api.imgur.com/3/image", {
            method: "POST",
            headers: {
                Authorization: "Client-ID //my client Id",
                Accept: "application/json",
            },
            body: formData,
        })
            .then((response) => response.json())
            .then((response) => {
                e.preventDefault();
                console.log(response);
                console.log(response.data.link);
                url_in = response.data.link;
            });
    } else {
        console.error("oversized file");
    }
}

This is input tag code

<input type="file" name="image" id="upload" onChange={imageUpload}></input>

I just need the url of the uploaded image

Things might cause the problem:

one

If you’re sharing an IP with someone, they could be contributing to the limit. Also, they may have interval limits where you can only send so many requests per short periods of time.

Also, be cautious of having all code running during development. If you have hot-reloading enabled in your development environment, the code may be running and sending requests every time you save. I accidentally exhausted my daily allocation for GitHub because I had hot-loading enabled on my development server. It made a request every time I saved my file as a result.

Two

Simply run HOST=0.0.0.0 npm run start.
Afterwards open the url from another device on the network.

In your case, 192.168.0.5:3000 would work.

Documentation for setting HOST environment variables.

I changed my start script in package.json to this "start": "react-scripts start --host 0.0.0.0" based on a comment someone made in this answer. Then I point my browser at http://0.0.0.0:3000/ and I’m able to get a response from imgur.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button