Questions tagged [fetch]

For questions about the Fetch API, use the [fetch-api] tag instead. For the git subcommand, use [git-fetch]. The [fetch] tag is a general-purpose tag for the keyword used in many programming languages, which is usually part of an instruction to retrieve data.

1
vote
1answer
50 views

Fetch doesn't send post data

I'm having this problem, where for some reason I can't send data to another PHP script with POST over the fetch API. I've already checked other solutions and cleaned up my code, but it still won't ...
0
votes
0answers
13 views

Service Worker fetch event is not being triggered

self.addEventListener('install', function (event) { console.log('SW Installed'); event.waitUntil( caches.open('static') .then(function (cache) { cache.addAll([ ...
0
votes
1answer
35 views

Making multiple requests to node.js API from React.js

I'm currently developing an application which uses a Node.js REST back-end with React.js on the client side. I'm having issues when trying to make multiple fetch requests to my API, leading to ...
0
votes
0answers
18 views

POST multiple user inputs with Fetch() - React Native [on hold]

I am fetching from an API many documents. Each document has multiple input fields. After displaying that document, user will write on those input fields. How can I save the state for each one of them ...
0
votes
0answers
31 views

How to compile Fetch API and promises for browser compatibility?

I'm curious as to what the best solutions are when you want to use fetch() and promises and have it compiled/poly-filled for optimal browser support. When i try to compile fetch/promise code on ...
0
votes
0answers
26 views

Can't extract Response body from API call for 4xx status codes (even 200 codes) [Unexpected end of JSON]

I'm trying to make a POST request to authenticate users. I'm unable to extract the response body for almost all status codes as each one provides a different issue. I've tried using both Fetch and ...
0
votes
2answers
23 views

Fetching data with axios in react

I'm new in react so I'm trying to make a get request with axios in react with a service to get a track and the respective races from it, but I got track like a empty object. I need to know how to make ...
2
votes
0answers
32 views

Posting to a server multiple parameters at once - React Native

I have a project where I am fetching from an API some data and I am rendering those data in React Native. After rendering, I am displaying a list of documents and when I click in one of them I pass ...
0
votes
0answers
9 views

.net core unable to fetch after deploy

Ey guys, I can't figure this out, I made .net core application with react. I connected SSRS execution report services for reports and now after publish I just can't execute simple fetch and ...
0
votes
0answers
19 views

How to fetch data from websites through Firebase function

I'm trying to fetch data from other websites through a Firebase function, but keep getting this error: Error: cannot handle this request exports.fetchData = functions.https.onRequest((req, res) =&...
-1
votes
0answers
15 views

CORS request did not succeed or missing [duplicate]

I trying to resieve json from openweathermap.org by fetch just from my local html file. And i getting an error CORS request did not succeed. And TypeError: NetworkError when attempting to fetch ...
0
votes
0answers
19 views

Intercept Fetch API calls wit Axios

We have a vanilla Javascript application that uses heavily fetch for AJAX requests. As I need to intercept those requests to put some custom headers and other data, we found out that axios could be a ...
0
votes
0answers
28 views

Trying to access the Behance API via fetch doesn't work but works via browser url [duplicate]

I'm having trouble connecting to the behance API. I registered my app, got my API key. And when I try it in my browser URL bar, everything works perfectly: But whenever I try to fetch it via my app, ...
-2
votes
1answer
50 views
+50

User registration with React, Axios and PHP backend

I new in React, pls help me. I need to register a new user with api .Backend developer gave me screenshot how he implemented registration on php.Unfortunately he doesn't know react so he can't help me....
0
votes
3answers
31 views

await aborts the function in a React app. why?

I am trying to fetch data and set the state in React App. While the fetch is successful, as I can see the data in chrome dev tools, the execution stops at await statement in the below code. Only "...
0
votes
0answers
15 views

How to deal with OPTION request?

I have the following code: window.fetch(myServerURL, { headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, method: "POST", body: JSON.stringify(app....
0
votes
2answers
34 views

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....
0
votes
0answers
26 views

AspNetCore Identity in Microsoft Edge

I am using Identity 2.0 with AzureAd in a .NET Core 2.0 application (React front end). All data calls are made using the fetch API; on the server side I either use the [Authorize] tag or check the ...
0
votes
2answers
33 views

how to fetch a javascript file content and parse it to use it's variables

I am trying to fetch this javascript file https://eloquentjavascript.net/code/journal.js by using a native fetch command like fetch('https://eloquentjavascript.net/code/journal.js').then(v => { ...
0
votes
1answer
17 views

R RMySQL Error could not find function fetch and unexpected input in dbConnect

I'm trying to run this code on 3 machines: install.packages("RMySQL") connect_ciao = function() { return(dbConnect( MySQL(), user = user, password = pw, host = ip )) } query ="...
0
votes
0answers
29 views

How to post data URLSearchParams With Fetch in IE 11

When I am trying to post bodydata using URLSearchParams in fetch, its working in Chrome v72 and Edge v40 but not on IE11 (with polyfills). On IE11: I am getting this error: Error: unsupported ...
0
votes
1answer
22 views

Fetch JSON from Google Maps Autocomplete and Submit it into Django Form Data

For my website, I want to place a Google Maps autocomplete form into a page, and when the user submits the coordinates, and will send the JSON to Django forms, so it can submit it into the database. ...
1
vote
0answers
30 views

Google App Script GET not returning readable response

I have a Google Script that is called with a GET containing a google drive file id and returns the name of the file. function doGet(e){ var id = e.parameter.id var fname = getFileName(id); ...
0
votes
1answer
26 views

ASP.NET Core Fetch POST FormData() application/x-www-form-urlencoded

I want to validate. The controller does not want to receive data. Eat remove ValidateAntiForgeryToken, then accepts null. In view Html.AntiForgeryToken(). Here is my code: getDataTable = async (e) =...
1
vote
0answers
43 views

React-native: Bad response when using fetch

I have this code in a new React-Native project: componentDidMount(){ var url19='http://e-twow.ro/gps/verifica_senzor.php?qr_code=RY7U2' fetch(url19) .then((response) =&...
0
votes
1answer
22 views

React fetch returns undefined but in console it returns response

I can see my response in first console, but then it is always undefined. fetch("/api/v1/legacy/tenant-shop", { method: "POST", headers: { "Content-Type": "application/json" }, body: ...
0
votes
0answers
16 views

Is there a way to trace the path of redirects when using fetch() in a browser

I'd like to send an AJAX request and collect all the URLs that it gets redirected to. Is that possible? I've seen the redirect: manual option of fetch(), but using it leads to a response with type: ...
0
votes
0answers
17 views

Does/will the Fetch API support other protocols than HTTP?

XMLHttpRequest supports protocols other than HTTP (file and ftp). Fetch API does not seem to support it currently - is this correct and if so, is support for other protocols planned?
0
votes
1answer
25 views

Async/Await Email Validation

I'm trying to write a function that checks an email entered into a form input using Async/Await. It looks something like this: //Check email entered if($('email')){ $('email').observe('blur', ...
0
votes
0answers
12 views

Is it possible to use a seperate cookiestore for fetch requests?

I'm developing a webapp which consists of multiple plugins. These plugins have the ability to fetch cross-origin resources, but I don't want them to share the same cookies, because of possibly ...
0
votes
0answers
15 views

Ensure React Native sends requests using HTTP/2 [duplicate]

How does one ensure React Native sends requests using HTTP/2? We'd like to take advantage of multiplexing features available in HTTP/2, but we're using Charles to proxy and are noticing HTTP/1.1 is ...
1
vote
2answers
29 views

React hook with fetch api

I want to make a very simple Fetch request (or axios request) and then map these results. For that, I'm using useState and useEffect, but I'm definitively doing something wrong. function App() { ...
1
vote
1answer
31 views

React Native - Why Fetch caches result?

I use Fetch to fetch data from server like this: fetch(url, { method: 'GET', cache: 'no-cache' }); It works fine without any caching sometimes, and sometimes it will get the same result(I'm ...
0
votes
1answer
31 views

setState() not mutating state immediately

I have a parent component that uses a get request to retrieve a JWT Token and then passes that token as a prop down to a child component. That token gets passed in another get request to authorize and ...
1
vote
1answer
35 views

Why do I get a CORS error on API Gateway GET request when the OPTIONS request has statusCode 200?

I am trying to make an GET HTTP request to a AWS API Gateway endpoint connected to a lambda function. The endpoint and lambda function work as usual when tested with postman which is logical since ...
0
votes
0answers
28 views

Get all remote branches to local repo based on author

I pushed my all local branches to the remote. Now I want to get all my remote branches in a new local repo. How to get only my branches? Is there any way to pull branches based on the author? Please ...
0
votes
0answers
25 views

Displaying multi dimensional array within Json File with ReactJS

Just started with Reactjs and I'm looking for the most efficient code to display the array below in a table structure as described in the 'render' section. I have been using .map to iterate, but with ...
-1
votes
0answers
37 views

How to fetch products prices from external URL and automatically update price changes? [closed]

I am working on a price comparison website. User will be adding products from external URL which I would like to fetch certain information from (title,price and product image from). I don't know if ...
0
votes
1answer
23 views

How do i stop the script executing at .then phase in fetch?

How do i stop the script executing at .then phase in fetch? I want the script to stop executing if the response and response.text is not empty fetch(url, { method: 'POST', body: data, ...
1
vote
1answer
34 views

Best way to display data form an api call

I was wondering what is the best way to display data from a rest api. Actually what I do: Call fetch function from componentDidMount(); setState to store my response Check with ternary when render()...
0
votes
1answer
26 views

Angular: conditionally set 'credentials' option in fetch

For an Angular app I need to make a few API calls to a Laravel backend, which has to temporarily store some data in a PHP session. The Angular app is running on http://localhost:4200, while the ...
0
votes
1answer
27 views

React JS - No 'Access-Control-Allow-Origin' header is present on the requested resource. Cross Origin Resource Error

Im making an API call(Running on another domain) using Fetch in a React Web app. I am getting the error Following error. Access to fetch at '--------API URL---------' from origin 'http://...
1
vote
1answer
32 views

Setting state with React Hooks + Fetch API does not trigger re-render

I'm trying to learn React Hooks by building a simple Domain Availability checker. Specifically, I'm playing with useState() The aim is just to have an input field where the user types a keyword, hits ...
-4
votes
0answers
16 views

CI - Fetch data and display [duplicate]

I need help fetching data from DB to CI project. My current db structure is: usernames is table name with the following rows: |----------------------------------------------------------| |id|title|...
1
vote
1answer
24 views

Variable outside of FB API fetch value returns undefined

I'm trying to loop the URL in FB API so that I can retrieve all the photos without paginating it (for photo searching), but when i try to define the value for "after", it always returns undefined. ...
0
votes
2answers
51 views

Fetch data from DB with CodeIgniter

I need help fetching data from database and display them in view. My DB name is directory and table usernames that includes:id,title,body,slug,username,platform,gender,age and created_at. I used ...
0
votes
0answers
38 views

Fetching data in CodeIgniter

I need help fetching data from database and display them in view. My DB name is directory and table usernames that includes:id,title,body,slug,username,platform,gender,age and created_at. I used ...
-1
votes
0answers
7 views

my Fetch as Google dose not show any thing

when I'm checking my website http://iranmct.com by google fetch, I can see this message. my server admin said: it's because of Cloudflare, but it has not any conflict. what's the problem? ...
1
vote
0answers
21 views

Get contents of a zip file

This URL below points to a zip file which contains a file called bundlesizes.json. I am trying to read the contents of that json file within my React application (no node server/backend involved) ...
0
votes
1answer
16 views

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 ...

http://mssss.yulina-kosm.ru