Questions tagged [fetch]

DO NOT USE. For questions about the JavaScript Fetch API, use the [fetch-api] tag instead. For the git subcommand, use [git-fetch]. This tag is ambiguous.

fetch is used in many contexts, include source control, database querying, and cache control.

References

11193 questions
2
votes
1 answer

Django + Service Workers: "a redirected response was used for a request whose redirect mode is not follow" error

I've been trying to build a progressive Django Web App with a service worker and django-pwa. Everything seems to work fine, but whenever I load the page, turn on offline mode in Chrome, and reload, I get this error: "The FetchEvent for…
2
votes
1 answer

Performing Fetch Request in a Loop

I am working on an application that returns a list of ids from first fetch request. After getting the ids, I have to loop through the ids and get details of each item and then display it on the screen. fetch(TOP_STORIES) …
john doe
  • 9,220
  • 23
  • 91
  • 167
2
votes
1 answer

React Redirect in Fetch

I must have this setup incorrectly because it is not working. If I put a console.log in my if statement it shows up, so I know it is getting to that point, but it is not redirecting. Am I doing this wrong... ... checkUserAuth = () => { return…
JamieTom
  • 101
  • 2
  • 14
2
votes
1 answer

How to do realtime fetching in react native?

Hi in my project there is comment section for a video.So what I'm expecting is showing the comments immediately after a user post it.I've tried componentWillUpdate() method.But it is re-rendering the UI everytime,so causes some shaking in UI.Also…
Linu Sherin
  • 1,712
  • 7
  • 38
  • 88
2
votes
0 answers

upload mp4 with expo in react native problem

I'm new in react native and this might be a silly question, but when I'm trying to upload .mp4 with react native using expo in my backend server side (laravel) I receive a jpg/jpeg file which is weird because with the same code when I try to upload…
sina farbod
  • 497
  • 4
  • 17
2
votes
3 answers

React-Native multipart photo upload not working in android

I'm trying to send/upload image file to my back-end serve using fetch multipart upload in react-native, but fetch multipart form data upload is not working for android, however I tried different examples. Image upload multipart form data API is…
Rajender Kumar
  • 1,377
  • 19
  • 32
2
votes
1 answer

New CORS policy for Instagram API?

I had some code suddenly break on me around 02/13/19, and it looks like the cause is a CORS issue on the Instagram API Endpoint GET/users/self/media/recent. Everything was working fine on 02/12/19, two days later the CORS issue comes up every…
David C
  • 64
  • 2
  • 9
2
votes
1 answer

Dynamic request with node-fetch

I need to obtain a value from an API which is actualized quickly. The problem is that the code I wrote bring me always the same value. I tried two ways: var fetch = require("node-fetch"); for(let i=0; i<5; i++){ setTimeout(function(){},…
2
votes
1 answer

React Router Dom Multiple Paths 1 Dynamic Component

I have one component that has a fetch call in componentDidMount(). I want to use the URL route to dynamically change my fetch call. In my index.js, I have: ReactDOM.render(
Ddeokbokki
  • 131
  • 2
  • 10
2
votes
2 answers

Is there a way to slow down async-await fetch calls inside a for-loop/forEach in order to avoid per-second API quotas?

I am working on an app that requires calls to the foursquare places api, which has a 2-calls-per-second quota. The app pulls a list of places, an then has to separately call the pictures for each place. I have attempted to do this within a forEach…
E_C
  • 300
  • 2
  • 10
2
votes
5 answers

How to handle divide by zero in Oracle function

I'm getting a divide by zero error when I use this function. It compiles fine. Since I'm not using a select statement I'm assuming NULLIF isn't going to work. What can I use to avoid the divide by zero issue? OPEN GET_DATA; fetch GET_DATA…
doc
  • 23
  • 1
  • 1
  • 4
2
votes
1 answer

Processing fetch response - JS

I have the response after GET-request with fetch. I know that this response will return an Array. When I process it with .json() - everything is fine. But when I try to process same response with .formData()- it fails. Here's the…
sh00ter
  • 35
  • 3
2
votes
2 answers

Cannot get the data on the list with fetch and reactjs

I developed a list which get the data of my product, I try that with the fetch and I get the data on the console but It not rendering on the list. My code is : constructor(props) { super(props); this.state = { …
Ichrak Mansour
  • 1,850
  • 11
  • 34
  • 61
2
votes
1 answer

After fetch state returns undefined

Im using fetch to post data to my local api, but when trying to get them and error like this occures. In fetch i get result perfectly fine, but after that trying to pass that into state like below: this.setState({ items: result.items…
asi hej
  • 143
  • 1
  • 10
2
votes
1 answer

How to wrap JavaScript fetch in a function - unhandled promise rejection

I'm trying to write a wrapper function for the JavaScript fetch command. I took the example code from this post: function fetchAPI(url, data, method = 'POST') { const headers = { 'Authorization': `Token ${getAuthToken()}`, }; return fetch(url,…
Little Brain
  • 2,647
  • 1
  • 30
  • 54
1 2 3
99
100