Skip to content

Tag: fetch

error code 401, HTTP Token: Access denied

I am new to using API’s. I’ve been trying to use this API called Carbon Interface. it supposed to give an estimate of your carbon footprint based on how much electricity you use. I created this quick project to test it but whenever I try to use it I get error code 401, I look it up and it’s …

How to resolve CORS error in Fetch API js

I want to fetch json from my subdomain (File Hosting Server) , but it gets the following error: Reason: CORS request did not succeed) (Reason: CORS header ‘Access-Control-Allow-Origin’ missing my similar code: I add but don’t work. I add to code, fetch file but return response status 0 , mode: ‘op…

Progress for a fetch blob javascript

I’m trying to do a javascript fetch to grab a video file using fetch. I am able to get the file downloaded and get the blob URL, but I can’t seem to get the progress while its downloading. I tried this: The problem is that I get “Response.blob: Body has already been consumed”. I see th…

Cannot destructure an object

I fetched and object which contains two properties, one is a number and one is an array. So I right away accessed the array and then assigned to a state and then passed each item to another component through context api. And it does not working. Here is my code: In this code ‘correct_answer’ is a …

How do I use an API in Discord.js?

I was looking for a cool way I could automate some interesting news articles on my discord server. I wanted to use webhooks at first but then decided to go with APIs. I looked all around and saw that I should go with New York Times API but when I went to code it, it came up with a few