Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
35 views

I am using a spring boot as backend and react frontend to create a website and I am encountering an error when fetching a user profile using browser from the backend.After login i managed to generate ...
mohamed yusuph's user avatar
-1 votes
0 answers
38 views

when i fetch subscription from google play console it fetch the datas successfully. but the purchase does not work. it has some error SubscriptionCard.js:99 Purchase error: {code: 'item-unavailable', ...
Kamal's user avatar
  • 1
-1 votes
0 answers
76 views

i get the data from the server with fetch API it contains html, when i click on load more posts button it should load the html at the bottom of the page we got from the server, but it also loads the ...
Samyar's user avatar
  • 25
-3 votes
1 answer
103 views

I am getting data from the server. The view must renders an html page without reloading the entire page، but this renders whole page including the header of current page, this is a problem, each time ...
Samyar's user avatar
  • 25
-2 votes
0 answers
63 views

I have a .NET website running on an internal IIS10/Windows Server 2022 machine. It has an internal SSL cert authorised by our domain. It works with HTTP/1.1 and HTTP/2. It's configured to pass an alt-...
Keith's user avatar
  • 157k
1 vote
2 answers
77 views

I’m trying to send a JSON payload to my backend API using fetch in React, but the server keeps returning: 415 Unsupported Media Type Here is the code I'm using: const sendData = async () => { ...
Oleg Solltys's user avatar
1373 votes
34 answers
4.3m views

I'm trying to fetch some data from the REST API of HP Alm. It works pretty well with a small curl script—I get my data. Now doing that with JavaScript, fetch and ES6 (more or less) seems to be a ...
daniel.lozynski's user avatar
0 votes
1 answer
122 views

I have been working on a personal project for a while now and during a testing phase for a database, it began reporting that CORS was preventing the file from being fetched, and stopped my testing in ...
voltage's user avatar
  • 13
0 votes
1 answer
92 views

In the html intro to a web app for a scientific study, data is collected through forms. I added a javascript function that submits the data via the fetch API: fetch('/prepare/', { "method":...
Langtec's user avatar
  • 105
0 votes
0 answers
86 views

I’m trying to call an external API from my JavaScript code using the fetch() method. It works perfectly on my local environment, but when I upload the same code to my website, I get a CORS error like ...
Dhiraj Gurung's user avatar
1148 votes
19 answers
2.0m views

I'm trying to POST a JSON object using fetch. From what I can understand, I need to attach a stringified object to the body of the request, e.g.: fetch("/echo/json/", { headers: { '...
Razor's user avatar
  • 30k
1 vote
1 answer
57 views

I’m working on a Laravel Blade view (monitoring.blade.php) where I have an edit and save button for each row. The edit button works, but when I click the save button, nothing happens — no console logs,...
aDiosuno's user avatar
4 votes
1 answer
132 views

Trying to make a cross-origing fetch request with the no-cors mode I found out it is not possible in this case to send any data to the server as a body: const url = 'http://cross-origin-example.com/...
Ilya Loskutov's user avatar
433 votes
19 answers
439k views

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 (currently ...
texas697's user avatar
  • 6,587
571 votes
14 answers
881k views

I'm trying to use the new Fetch API: I am making a GET request like this: var request = new Request({ url: 'http://myapi.com/orders', method: 'GET' }); fetch(request); However, I'm unsure how ...
mylescc's user avatar
  • 7,039
547 votes
13 answers
1.3m views

I can hit this endpoint, http://catfacts-api.appspot.com/api/facts?number=99 via Postman and it returns JSON Additionally I am using create-react-app and would like to avoid setting up any server ...
dwww's user avatar
  • 5,728
2 votes
1 answer
149 views

I'm running the code below. The output I was expecting was: Start -> End -> While expires -> joke -> setTimeout However, the output I’m actually getting is: Start -> End -> While ...
Interstellar's user avatar
327 votes
18 answers
473k views

I have a fetch-api POST request: fetch(url, { method: 'POST', body: formData, credentials: 'include' }) I want to know what is the default timeout for this? and how can we set it to a ...
Akshay Lokur's user avatar
  • 7,646
241 votes
42 answers
499k views

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 is a ...
Alek Hurst's user avatar
  • 4,863
450 votes
13 answers
545k views

How may I get information from a ReadableStream object? I am using the Fetch API and I don't see this to be clear from the documentation. The body is being returned as a ReadableStream and I would ...
noob's user avatar
  • 6,984
1 vote
0 answers
121 views

I’m building a small full-stack project using Next.js (frontend) and Express.js (backend) with a MySQL database. The Express backend has this route: // server.js import express from "express&...
Shivam Parmar's user avatar
0 votes
1 answer
66 views

Problem: I’m trying to fetch popular movies from the TMDb API in my Next.js project, but I keep getting a signal timed out error. Here’s the error log: TMDb API Error: signal timed out at ...
Yashhh..'s user avatar
370 votes
12 answers
570k views

I am trying out the new Fetch API but is having trouble with Cookies. Specifically, after a successful login, there is a Cookie header in future requests, but Fetch seems to ignore that headers, and ...
Khanetor's user avatar
  • 12.4k
0 votes
1 answer
75 views

I'm trying to write a custom React hook that fetches data. It seems to work partially — but loading goes false before data is set, and error is never set even when a request fails. import { useState, ...
Work Profession's user avatar
0 votes
0 answers
90 views

EDIT 2 (please reinstate this question) As (see below) the CancellationToken is NOT sent from caller to callee of an API, how does .NET C# know to apply the default= option of a Controller methods' ...
McMurphy's user avatar
  • 1,483
419 votes
11 answers
690k views

My code: fetch("api/xxx", { body: new FormData(document.getElementById("form")), headers: { "Content-Type": "application/x-www-form-urlencoded", // "Content-Type": "multipart/...
Zack's user avatar
  • 4,489
349 votes
12 answers
216k views

I'm trying to call a web service for my application, and there are two options available: Fetch and Axios. I'm not sure which one to choose, so I'm looking for information to help me decide. Can you ...
Gorakh Nath's user avatar
  • 9,906
269 votes
14 answers
561k views

Here's what I have going: import 'whatwg-fetch'; function fetchVehicle(id) { return dispatch => { return dispatch({ type: 'FETCH_VEHICLE', payload: fetch(`http:...
Vlady Veselinov's user avatar
353 votes
11 answers
500k views

I am still trying to wrap my head around it. I can have the user select the file (or even multiple) with the file input: <form> <div> <label>Select file to upload</label&...
deitch's user avatar
  • 14.8k
209 votes
19 answers
1.0m views

I'm using fetch API within my React app. The application was deployed on a server and was working perfectly. I tested it multiple times. But, suddenly the application stopped working and I've no clue ...
Amanshu Kataria's user avatar
-1 votes
1 answer
67 views

I have a code for updating the quantity in the cart by a fetch() request, and I modified it a little: updateMainItem(line, quantity, name, variantId) { const body = JSON.stringify({ line, ...
s.kuznetsov's user avatar
  • 15.3k
194 votes
19 answers
494k views

When fetching data I'm getting: Can't perform a React state update on an unmounted component. The app still works, but react is suggesting I might be causing a memory leak. This is a no-op, but it ...
Ryan Sam's user avatar
  • 3,057
183 votes
12 answers
215k views

When the request status is greater than 400(I have tried 400, 423, 429 states), fetch cannot read the returned json content. The following error is displayed in the browser console Uncaught (in ...
Luna's user avatar
  • 2,362
0 votes
0 answers
29 views

As the title says. This code reproduces the issue. My environment: Windows 11, ArchWSL, Volta, [email protected], [email protected] import fs from "node:fs"; import { Buffer } from "node:buffer&...
anmoti's user avatar
  • 11
332 votes
8 answers
232k views

There is a new API for making requests from JavaScript: fetch(). Is there any built in mechanism for canceling these requests in-flight?
Sam Lee's user avatar
  • 10.6k
-4 votes
1 answer
124 views

How can I asynchronously create two hundred API requests in a quick manner to an API, that is https://api.dictionaryapi.dev, in JavaScript? I want to catch CORS errors with an error status of 429 ...
horsey_guy's user avatar
301 votes
9 answers
376k views

I want to write a simple basic authentication with fetch, but I keep getting a 401 error. It would be awesome if someone tells me what's wrong with the code: let base64 = require('base-64'); let url =...
daniel.lozynski's user avatar
35 votes
3 answers
46k views

I got this error after updating to angular 17: NG02801: Angular detected that `HttpClient` is not configured to use `fetch` APIs. It's strongly recommended to enable `fetch` for applications that use ...
Amir Abaris's user avatar
1 vote
1 answer
63 views

I’m trying to call an async function and get the result, but instead of the actual data, I get a pending Promise. Here’s a simplified version of my code: async function getData() { const response = ...
Nadeem's user avatar
  • 11
228 votes
15 answers
216k views

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-level ...
neezer's user avatar
  • 20.7k
3 votes
1 answer
306 views

This is the Next.js frontend: // Create FormData to send files, URLs and username to the API const formData = new FormData(); if (files && files.length > 0) { files.forEach((file) =>...
Sarthak Rastogi's user avatar
-2 votes
1 answer
102 views

I'm building a website hosted on Netlify that submits a form to a Google Apps Script web app. The form data is sent as JSON with the Content-Type: application/json header using the fetch API. The ...
Dean Winkelmann Dusk Duo's user avatar
0 votes
2 answers
314 views

const acceptRequest = async () => { try { const res = await fetch(`${process.env.NEXT_PUBLIC_SOCKET_SERVER_URL}/acceptRequest`, { method: "POST", body: JSON....
Dhuruv Bansal's user avatar
196 votes
12 answers
304k views

If I want to download a file, what should I do in the then block below? function downloadFile(token, fileId) { let url = `https://www.googleapis.com/drive/v2/files/${fileId}?alt=media`; return ...
zachguo's user avatar
  • 6,826
20 votes
5 answers
21k views

I am using the Fetch API introduced in NodeJS 18 to access an API. However, the request always times out after 10 seconds with the following error message. TypeError: fetch failed at Object.fetch (...
radostin04's user avatar
31 votes
10 answers
93k views

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 I ...
CIB's user avatar
  • 795
230 votes
7 answers
193k views

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 => { // how ...
Sibelius Seraphini's user avatar
50 votes
4 answers
76k views

I have this code in my app/page (Server Component): const getUsers = async () => { const result = await fetch('/api/users', {method: 'GET'}); if (result.ok) { return result.json(); } ...
Amy Blankenship's user avatar
253 votes
7 answers
206k views

I've been messing around with the fetch() api recently, and noticed something which was a bit quirky. let url = "http://jsonplaceholder.typicode.com/posts/6"; let iterator = fetch(url); iterator ...
haveacigaro's user avatar
  • 2,679
19 votes
6 answers
26k views

I'm working on a Next.js application which was originally a normal react app (created with create-react-app) and I am trying to send cookies with a fetch request to my server. However, the cookies ...
FunkyPenguin's user avatar

1
2 3 4 5
125