Top "Fetch-api" questions

The Fetch API is an improved replacement for XHR, for making asynchronous HTTP requests while better managing redirects and interaction with CORS and Service Workers.

How can I fetch an array of URLs with Promise.all?

If I have an array of urls: var urls = ['1.txt', '2.txt', '3.txt']; // these text files contain "one", "…

javascript promise es6-promise fetch-api
fetch: Reject promise with JSON error object

I have an HTTP API that returns JSON data both on success and on failure. An example failure would look …

javascript promise es6-promise fetch-api
Fetch: set variable with fetch response and return from function

I'm quite new with JavaScript and react. I have a callback from a component that gets a customer_name from …

javascript ajax reactjs fetch-api
First Fetch API call cancelled by the second in IE11

I have a ReactJS application that works as expected in Chrome, but fails in IE-11. The problem is this - …

javascript internet-explorer-11 fetch-api
How to make javascript fetch synchronous?

I'm using fetch to get data json from an api. Works fine but I have to use it repeatedly for …

javascript json asynchronous fetch-api
How to fetch XML with fetch api

I'm trying to making a weather app that displays the weather and the temperature of many days of the week. …

javascript xml fetch-api
fetch(), how do you make a non-cached request?

with fetch('somefile.json'), it is possible to request that the file be fetched from the server and not from …

javascript html fetch-api
fetch() does not send headers?

I am sending POST request like this from browser: fetch(serverEndpoint, { method: 'POST', mode: 'no-cors', // this is to prevent browser …

javascript http post cors fetch-api
using a fetch inside another fetch in javascript

I want to get an api and after that call another one. Is it wisely using a code like this …

javascript fetch-api
Fetch vs. AjaxCall

What is the difference between typical AJAX and Fetch API? Consider this scenario: function ajaxCall(url) { return new Promise(function(…

javascript ajax fetch-api