Questions tagged [axios]

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

Filter by
Sorted by
Tagged with
7
votes
2answers
299 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 ...
0
votes
0answers
26 views

Discord bot file requirement and object instantiation d20pfsrd follow-up

I have written a series of parsers for a discord bot that each reside in classes in their own files. Each parser class has 3 functions, 2 of them are for generating the response to the discord message ...
2
votes
0answers
60 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. ...
6
votes
1answer
171 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
1answer
340 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
1answer
38 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 ...
1
vote
0answers
121 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, ...
4
votes
1answer
3k 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
0answers
59 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
1answer
352 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
1answer
191 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 ...
3
votes
2answers
290 views

Idomatic way to ignore `finally` block after cancelling network request

In React, it is quite common for me to have something similar to the following. ...
3
votes
1answer
36 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 ...
3
votes
1answer
173 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: ...
4
votes
1answer
49 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 ...
4
votes
1answer
124 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 ...
3
votes
1answer
112 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 ...