Questions tagged [fetch-api]
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.
fetch-api
6,190
questions
0
votes
0
answers
7
views
Chrome pre-flight returning blocked by CORS: does not have ok status, while my .rest client gives 200
I am using the chrome extension Allow CORS: Access-Control-Allow-Origin with all sorts of different setting changes, including this custom rule: Chrome running a pre-flight for my typescript fetch ...
0
votes
0
answers
39
views
.then works as expected, async/await does not
I have the following helper function:
async function post(url, fData) {
const response = await fetch(url, {
method: "POST",
credentials: "include",
body:...
0
votes
1
answer
11
views
fetch api structure for FormData
I am creating structure for FormData in fetch API, but there is something that i am missing. it will be helpful if someone can help me. Here is the code.
const fetchFormData = async (url, method = '...
0
votes
0
answers
13
views
React/NextJS After Fetching Can't Get Map function to show
I'm new to React/NextJS and trying to do a simple fetching and whenever I try to use the map function it does not seem to go inside it. I'm not sure what I'm doing wrong, I'm following some tutorials/...
-3
votes
1
answer
41
views
How to hide or encrypt api calls from Network tab? [closed]
When I communicate with my server using API calls from client side. I saw my api address completly visible in the network tab. And my api data also visible in the payload. So any one can communicate ...
1
vote
1
answer
25
views
CORS error when fetching image from container using docker-compose
I have a NextJS frontend blog app that retrieves images and videos from a separate animations API. When this is all being run locally (frontend blog at localhost:3000 and animations API at localhost:...
-2
votes
1
answer
56
views
How to fetch text format response from API in frontend
I am getting a response "executed successfully" in text/html format from API with status code 200.
I want to show response to user through notification.
I tried to store that response in ...
1
vote
1
answer
29
views
Is there any way to get the detailed error behind "TypeError: Failed to fetch"?
I'm trying to debug why <2% of my users receive "TypeError: Failed to fetch" on a given endpoint. I'm seeing this error in Sentry, but I cannot reproduce it.
What I've figured out is that ...
0
votes
0
answers
8
views
How to solve CORS error while using Axios?
I want to make a request to 3rd party API for some data. While using axios for request I am getting CORS error, while the requests are success while using Fetch API.
Is there something I need to tweak ...
0
votes
0
answers
23
views
My fetch requests are stuck on pending and never fulfill a response or make it to the backend
I'm making an application using react, node and firebase and am trying to connect my backend to my front end. I have developed out backend routes and api but when I try to make requests from the front ...
-2
votes
0
answers
46
views
I got an error when trying to run: Failed to upload image. Please try again. Error: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
This is the js code that I am using to package the json, I use the response.json() packaging method, responseClone variable is required to hold a clone of the response object because the body of a ...
0
votes
2
answers
59
views
Why when i send a fecth requst to Open Weather API in React JS. React first return me undefined an after that data?
I watn to make Weather App. I just start study react. I do a fetch request to Open Weather API to get a weather data. When i consol.log(data) and update my page, React first return me undefined and ...
0
votes
0
answers
16
views
+50
Need clarification on httponly cookie restrictions on firebase functions (v2)
Note: I am using firebase functions "v2" (const functions = require('firebase-functions/v2'))
So, according to several sources, which I will list at the end, it seems as though the firebase ...
-3
votes
0
answers
36
views
Fetch Api Call - JavaScript [duplicate]
How to use sync and await during fetch call in Javascript.
I have a separate JS file like 'APIService.js' which used fetch api to external Url.
function APIService(){
this.getData = asyn function(...
1
vote
0
answers
17
views
Can't recognize audio file in Flask backend
I am having difficulty processing an audio blob I am sending to a Flask backend. I want to process the blob into a mel-spectrogram using librosa/pydub, but I get the following errors:
ERROR:root:...