i have problem with gettin data. how can I fix this? Answer you have to import axios library
Tag: axios
How do I wait for multiple promises to resolve but also include a set minumum delay?
I am calling two APIs with two different functions and having a setTimeout for both, is it possible to handle their timeouts in such a way that they finish in 10s instead of 15s. Is there a way to run this code only in 10s, so that both the APIs get called in 10s time period Answer Forcing either one
Axios is returning empty string value
The problem I’m facing here was, whenever I fetch the data with a button click (the button that leads to this route), the data will be fetch successfully, but whenever I input the link address directly myself in the browser, It keeps returning empty string when i console.log the data (Like this <empty string>), and keep throwing error saying “allCars.map
Firefox stops receiving responses after some HTTP requests (React + Axios, Node.js backend), sends only OPTIONS
As the title says, this only happens in Firefox. After some time the browser only sends OPTIONS requests with no responses, no status, no headers, nothing I can see in the debug console. All of this works perfectly under Chrome, Safari and Edge. I’ve already set up CORS middleware and headers within NodeJS, so that’s likely not the issue. I’m
Slack API upload string as file
I have a sting variable of a csv. I want to upload it to a slack channel as a .csv file, not as text. This code returns: error: ‘no_file_data’, Changing content to file gives the same response. What do I have to do to convert the csv sting into a file that can be uploaded? I can’t use fs to
The JSON data sent from Javascript is different than the JSON input received in Java Quarkus Service
I am developing a simple web application using the Vuejs/Nuxtjs which is making a backend call to Java Quarkus Service using the Axios POST request. Within the POST request I am sending the JSON data. The problem I am facing is that the JSON data that I am sending is bit different than the data I am receiving in the
How to update this axios service for being able conditionally decide which API URL to use?
I have the following axis service: I need conditionally pass isAdmin from outside for being able to switch the API URL here. How can be it achieved. Answer You can use multiple instances for each baseURL and call the instance by isAdmin condition. However, you can config the defaults that will be applied to every request.
[Redux][Axios][React] Adding redux state inside of a axios / action file
I want to add/change a redux state when the data is received from the backend. This state controls a loading spinner. The code below is what I thought that should work. What am I missing? CouriersActions.js Answer A simple way of solving this kind issue, create custom hook for all services and where ever you need it. Inside component
How to use a custom React hook to make a POST or DELETE request with Axios
I am trying to make a generic useAxios hook in React. I would like to be able to import this hook into other components to make Get, Post, and Delete requests. I have created the hook and it works fine for making Get requests, but I am stuck on how to make it work for Post/Delete requests. The issue is
Why is axios not returning correctly
I am trying to replace a fetch with axios. I keep getting undefined in my console log. … the commented out fetch is working. I just now added the .json even though axios should not need it. Neither way works. What am I doing wrong? Answer Did you even console.log(response) just to see whats inside of it? I guess you