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 to get the content-length of the response from a request with fetch()

I was getting an error when returning response.json() when I would do a request with an empty response body, …

javascript fetch-api
typescript Cannot add headers to a fetch api using react-native

I am using Fetch API from react-native and I am using typescript. My code looks like this: let responseLogin = await …

json typescript react-native fetch-api
Trying to access response data using fetch

I'm trying something simple where I make a request from the front end of my app using the fetch API …

javascript node.js fetch-api
async / await not working in combination with fetch

I'm trying to use ES7 async / await together with fetch. I know I'm close but I can't get it to …

javascript async-await fetch-api ecmascript-next
Polyfill for TextDecoder

I'm using fetch and have included the whatwg-fetch polyfill in my application. I also employ TextDecoder as described in Jake …

javascript fetch-api polyfills
How to unit test a React component that renders after fetch has finished?

I'm a Jest/React beginner. In jest's it I need to wait until all promises have executed before actually checking. …

reactjs jestjs fetch-api jest-fetch-mock
How to get headers of the response from fetch

I am using fetch on chrome Version 52.0.2743.82 (64-bit). I want to get all the headers in the response. Following snippet …

javascript cors fetch fetch-api
UseEffect being called multiple times

I thought useeffect is called once only after render, but its being executed multiple times and not in the order …

javascript reactjs fetch fetch-api use-effect
Fetch API, custom request headers, CORS, and cross-origin redirects

I need to make an HTTP GET request with custom request headers in-browser and process the result as it streams …

http cors fetch fetch-api preflight