Questions tagged [axios]
a promise based HTTP client for the browser and node.js
20 questions
1
vote
1
answer
107
views
Axios wrapper used with API requests
I have created Axios wrapper following SOLID principles. Is there any feedback on improving it's structure in a more cleaner and better way?
axiosconfig.ts
...
3
votes
1
answer
66
views
Generate total property sold for given postcode
I had to implement the below as a coding challenge.
There are two http endpoints. The first http endpoints returns a list of postcodes. The second http endpoint takes a postcode as a parameter and ...
0
votes
1
answer
691
views
Upload multiple images using react and axios
I trying to upload multiple images about (5000 of size upto 50mb) and trying to figure out what would be the best way to do it.
right now i have this code:
...
0
votes
1
answer
194
views
How to deal with nested callbacks in a clean way?
I am currently migrating some code from class-based components to function components using hooks in React. Where I have come across a piece of code that works as expected but there are 3 Axios calls ...
4
votes
1
answer
964
views
A React - Typescript custom hook for any request (GET, POST, PUT, DELETE) to my back end
I'm building a full stack exercise app and some of my objects include routines, exercises, exercise sets etc. Instead of writing out specific get, post, put and delete requests for each resource, I ...
7
votes
2
answers
1k
views
Take postcodes and get the Lat long information from them
I had an interview task which was the final stage, however, the feedback I got back for my solution was that it lacked effort and structure. I would be grateful to ...
3
votes
0
answers
88
views
Which one should I choose for simple task: async/await or promise.then?
I made a helper function for drawing the map(OpenLayers).
Then I made another helper function for fetch(axios.get) the map URL.
...
7
votes
1
answer
400
views
How do I refactor this fetch request?
I have this code that fetches data from a 3rd party api and sends it to my backend to be processed. The 3rd party api needs to target the user's localhost address so it has to come from the front end. ...
4
votes
1
answer
765
views
Access token regeneration for Axios requests
Description
I've developed an application which use axios to communicate with the PayPal API. PayPal has a NodeJS SDK, but unfortunately this doesn't support the ...
0
votes
1
answer
405
views
Getting data from API every x seconds and store it in a database
I'm currently getting data from an API every 15 seconds. This data contains a json with 100-2000 new items every time. Now i don't need all the items that are in there but still quite some of them and ...
4
votes
1
answer
6k
views
Disabling a form button while there's an http request running
I have a form built with react, formik and yup, and this form has some async validations. Apparently, some users were able to bypass these validations, and to prevent some errors, I wanted to disable ...
2
votes
0
answers
81
views
Reduce repetition in these Redux CRUD actions
My React application manages some entities. I'm using Redux (with redux-thunk) to manage the application state. I've created a RESTClient based on Axios:
...
-1
votes
1
answer
1k
views
Try-catch-finally snippet [closed]
Using visual studio I created a snippet which helps me surround my already written or new code into a try-catch-finally block. I use axios for REST so there had to be separate error handling method so ...
3
votes
1
answer
275
views
multiple api calls through promise
update1:
- I need to make two different api calls.
- from the result of first api call I am getting id in the variable firstAPIid,
https://reqres.in/api/users?page=2
- I need to pass this id ...
5
votes
3
answers
937
views
Idomatic way to ignore `finally` block after cancelling network request [closed]
In React, it is quite common for me to have something similar to the following.
...