fetch-api Questions

3

Solved

I woud like to understand the difference between the two get methods, one work, the other not really but i don t understand why. This doesn't work: fetch('https://glo3102lab4.herokuapp.com/fee958...
Engud asked 13/2, 2018 at 19:49

5

Solved

In the console, when running node --experimental-fetch the fetch command is now natively enabled (node version >=17.6). see below However, when I add a typescript layer, I always get error TS23...
Solubility asked 28/2, 2022 at 11:18

15

Solved

I'm struggling to find documentation or examples of implementing an upload progress indicator using fetch. This is the only reference I've found so far, which states: Progress events are a high-le...
Weizmann asked 29/2, 2016 at 23:20

4

Solved

I know that Fetch API uses Promises and both of them allow you to do AJAX requests to a server. I have read that Fetch API has some extra features, which aren't available in XMLHttpRequest (and in...
Praline asked 22/2, 2016 at 9:5

4

right now Im working in App using Flutter and I have 4 different languages, I use json (arb files) for localization (translation) I need to pass different string values which app fetch them using A...

14

Solved

Here's what I have going: import 'whatwg-fetch'; function fetchVehicle(id) { return dispatch => { return dispatch({ type: 'FETCH_VEHICLE', payload: fetch(`http://swapi.co/api/vehicles/${id...
Tenuous asked 7/7, 2016 at 0:3

2

Solved

I am implementing abortable fetch calls. There are basically two reasons for aborting the fetch on my page: the user decides he/she does not want to wait for the AJAX data anymore and clicks a but...

1

Need to send a POST request with a JSON body. I have to use fetch. Original code snippet, which worked: headers = {'Content-Type': 'application/json'}; body = {path: 'path1'}; fetch(url, { meth...
Mangum asked 12/3, 2018 at 19:19

2

Is there any breaking difference between the experimental node fetch and the npm library node-fetch ?
Airport asked 21/3, 2023 at 12:26

6

Solved

I'm using fetch polyfill to retrieve a JSON or text from a URL, I want to know how can I check if the response is a JSON object or is it only text fetch(URL, options).then(response => { // ho...
Berm asked 9/5, 2016 at 16:51

3

I make project using nextjs 13.4.7 and already install swr in 3 PC but I got the same error: Attempted import error: 'swr' does not contain a default export (imported as 'useSWR'). error TypeError:...
Barreto asked 26/6, 2023 at 5:21

2

I'm invoking an authentication service via javascript fetch to get an access token. The service is a simple RESTful call. I can see the call is successful using fiddler (with a 200 response and jso...
Eliza asked 8/8, 2016 at 16:44

1

I am trying to send an HTTP request using fetch with a stream as its body (reference). The request is being sent to my node server. However, I am getting the error "net::ERR_H2_OR_QUIC_REQUIRE...
Limacine asked 6/6, 2023 at 8:10

18

Solved

I have some parameters that I want to POST form-encoded to my server: { 'userName': '[email protected]', 'password': 'Password!', 'grant_type': 'password' } I'm sending my request (curre...
Trincomalee asked 10/2, 2016 at 20:34

11

Solved

I am using fetch() to grab data from api server. My error looks like this: Uncaught (in promise) SyntaxError: Unexpected end of input at fetch.then.blob. Can you please tell me what am I doing...
Prothallus asked 15/8, 2017 at 16:15

41

Solved

When I create a brand new project using react-native init (RN version 0.29.1) and put a fetch in the render method to the public facebook demo movie API, it throws a Network Request Failed. There i...
Behind asked 17/7, 2016 at 7:42

4

The problem is i am getting the cors error (response header does not contain Access-Control-Allow-Origin) when i try to fetch using fetch API. Here is my cors config in S3 - <?xml version="1.0...
Seligmann asked 21/7, 2019 at 19:53

5

Solved

I have API on Node server returning JSON like this when called: {"result":[{"ProductID":1,"ProductName":"iPhone10","ProductDescription":"Lates...
Lyle asked 6/3, 2021 at 15:29

8

Solved

If I have an array of urls: var urls = ['1.txt', '2.txt', '3.txt']; // these text files contain "one", "two", "three", respectively. And I want to build an object that looks like this: var text...
Copyreader asked 29/7, 2015 at 20:46

4

I'm aiming to build a Typescript library with AJAX calls (by using the fetch API), that can be used by both client-side (Webpack/Browserify) and back-end developers (Node). However, I can't seem t...
Telegraphic asked 8/7, 2017 at 15:40

5

Solved

I am trying to 'connect' my small React JS app with my Deno API backend on my local environment with fetch(). const apiUrl = `http://localhost:8000`; try{ fetch(apiUrl) .then((res) => res...
Lento asked 10/6, 2020 at 10:39

3

Solved

The question is, how can I get rid of calling second fetch 300 times? Or is there another way to do that, what I`m doing? Additionally how to do ordered(don`t wanna sort) calls of first api, becaus...
Offence asked 16/3, 2020 at 17:20

10

I'm setting up a next.js website with strapi but running into an issue with my fetch request. When I make the request in postman I can see the data is returned so the endpoint is correct. The error...
Sammiesammons asked 22/10, 2022 at 16:10

4

I am using fetch to make some API calls in react-native, sometimes randomly the fetch does not fire requests to server and my then or except blocks are not called. This happens randomly, I think th...
Dentist asked 4/1, 2017 at 15:19

3

Solved

I'm trying to use the Javascript fetch method, however, it does not seem to work asynchronously. Here's my code: fetch(`${global.URL}${url}`, requestConfig) .then(res => res.json()) .then(res ...
Voltz asked 12/8, 2020 at 13:41

© 2022 - 2025 — McMap. All rights reserved.