Questions tagged [axios]

a promise based HTTP client for the browser and node.js

Filter by
Sorted by
Tagged with
3 votes
1 answer
44 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 ...
hulike2286's user avatar
0 votes
0 answers
22 views

Effective cache solution to have the newest data in React Native

Goal We have an app with different articles. I want to cache an article when the user has read it, but make sure that I display the latest data. I came up with this hook: ...
Gh05d's user avatar
  • 101
0 votes
1 answer
538 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: ...
code0x00's user avatar
  • 101
0 votes
1 answer
127 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 ...
anup's user avatar
  • 149
3 votes
1 answer
739 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 ...
gCoder's user avatar
  • 33
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 ...
user6248190's user avatar
3 votes
0 answers
77 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. ...
Ye Cai's user avatar
  • 31
7 votes
1 answer
324 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. ...
Adrian Sultu's user avatar
4 votes
1 answer
701 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 ...
sfarzoso's user avatar
  • 137
0 votes
1 answer
251 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 ...
Awesom-o's user avatar
  • 107
1 vote
0 answers
779 views

Maintaining current session across multiple requests

I am trying to migrate from request to axios, since request has been deprecated. Suppose that the URL 'https://www.example.com' receives a post request with formdata that contains login information, ...
yuval's user avatar
  • 119
4 votes
1 answer
5k 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 ...
sergioviniciuss's user avatar
2 votes
0 answers
64 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: ...
Robin's user avatar
  • 137
-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 ...
Suleman's user avatar
  • 169
3 votes
1 answer
252 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 ...
zi zi's user avatar
  • 49
5 votes
3 answers
805 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. ...
Marcel's user avatar
  • 137
3 votes
1 answer
50 views

JavaScript that deletes everything inside a folder on Box.com

I just finished a simple script for Node that will delete all the folders and files inside a specified folder ID through Box's API. It works by getting a list of items inside a folder, then generating ...
midnightnoir's user avatar
3 votes
1 answer
394 views

Display and search through a JSON's items in Vue.js

I have put together this small application that displays a "Users" JSON in an HTML5 table. I use Bootstrap 3, Axios and Vue.js 2 for this purpose. Here is the code: ...
Razvan Zamfir's user avatar
4 votes
1 answer
67 views

Cancelling ongoing http requests when next one is started - web app search feature

This piece of code is aimed to cancel any ongoing search requests sent from the web application if next request is started, e.g. after user updates the search term. I tested it in the final ...
michal's user avatar
  • 41
4 votes
1 answer
144 views

Fetching data from API in JavaScript

I'm using Axios to fetch data from an API, and don't know if this is the best way to deal with APIs in ReactJS or not. I want to know if anyone can suggest edits or something to make the code more ...
gretty volk's user avatar
3 votes
1 answer
151 views

Mini Tor implementation ("CLI only anonymous network")

The goal of my project is to build a mini "anonymous" network (like Tor is) (command-line only) using Node.js and frameworks (socket.io / axios / express). A ...
spyrox's user avatar
  • 31