What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-10-18 23:59:04
node.js untrusted_authority: The provided authority is not a trusted authority. Please include this authority in the knownAuthorities config parameter."
const fetch = require('node-fetch-with-proxy'); async function sendGetRequestAsync(url, options) { const response = await fetch(url, options); const json = await response.json(); const headers = response.headers.raw(); return { headers: Objec... Add solution -
Javascript 2021-10-12 00:16:07
js then vs await
async function fancyShowRainbow(){ const response = await fetch("rainbow.jpg"); const blob = await response.blob(); document.querySelector(".my-image").src = URL.createObjectURL(blob); } function showRainbow(){ fetch("... Add solution -
Javascript 2021-10-06 21:16:04
react fetch data in for loop
/* ORIGINAL CODE */ videoUrls=()=>{ let i=0; let urllist=[] for(i;i< this.state.data.length;i++){ fetch(`https://www.googleapis.com/youtube/v3/search?part=snippet&q=${this.state.data[i].name}&key=xxxxxxxxxxx0`) .then(respo... Add solution -
Javascript 2021-09-18 19:40:01
javascript get currency symbol from locale
async function getCurrencySymbol() { const response = await fetch("http://www.geoplugin.net/json.gp"); const data = await response.json(); return data.geoplugin_currencySymbol; } const currency = await getCurrencySymbol(); Add solution -
Javascript 2021-09-17 20:37:02
async vs await javascript
async function myFetch() { let response = await fetch('coffee.jpg'); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } let myBlob = await response.blob(); let objectURL = URL.createObjectURL(myBlob); let i... Add solution