All Questions
81 questions
0
votes
2
answers
59
views
Using promise.all with .then
I want to use await Promise.all with axios so that the requests can be sent concurrently. I have a map with the key as an id, and the value as an url. I want to retain the output also in a similar map,...
0
votes
2
answers
49
views
node axios call does not await promise
When I make network call via axios, the consuming service does not await it
Executing function:
accountResolved: (atNumber, bkCode) => {
return new Promise((resolve, reject) => {
axios....
-1
votes
1
answer
455
views
Axios catch crashes code, marked "UnhandledPromiseRejection"
I am trying to handle an axios call failure.
I wrote the function and the code:
async function createFunction (url, APIKEY, vendorType) {
return new Promise((resolve, reject) => {
const ...
0
votes
1
answer
279
views
Using promise, resolve and axios and get multiple same returns each time GET [duplicate]
I am currently learning nodejs and react, and I want to achieve data transmission between frontend and backend. During this, I found that every time I refresh the website, the console in the browser ...
0
votes
1
answer
96
views
Getting value undefined in axios call
I have following code calling post and get API calls.
Problem is I am getting customerDatas undefined..
Any idea why this issue is.
try {
let dataPromises = await axios.post('customers', {}, { ...
0
votes
1
answer
258
views
why axios returns [object Promise] instead of data? [duplicate]
I have a function that returns a value from an API. However, when I use the function within an EJS template, it returns a promise rather than the data.
When I console.log (data), it shows the actual ...
0
votes
1
answer
110
views
Nodejs multiple axios get requests return a Primise
How to return a Promise from the multiple axios get requests?
I have below code.
async function main() {
const URL_1 = 'abc.com/get1/data1';
const result_1 = await getData(URL_1);
const ...
0
votes
0
answers
30
views
NodeJS function return empty result because of sync/async [duplicate]
I have a function which get a list of ids from a request I'm doing with axios.
Then, I display the list of ids in my main function.
const axios = require('axios');
function getListOfIds(){
var ...
0
votes
2
answers
2k
views
Why my promise based request returns Promise object on return and expected data in console.log [duplicate]
please check the below axios get request example to a random public api.
Intro
I would simply like to create a function which will execute get requests and return data, so I can store the returned ...
0
votes
1
answer
346
views
Nodejs api gives the same result if hit multiple apis in a loop
Created APIS in the backend(nodejs)
Now hitting that API from frontend or from another server backend
When I hit the requests in the loop, it gives the result of the previous request.
Suppose we're ...
0
votes
0
answers
53
views
nodejs can´t handle http successfully responses due to (probably) high volume of promises - Growth problems
I am finding my self blind on how to understand the root cause of this problem. Any direction is very welcomed
I´ve made some tests as well which I am going to show here
A) --- General Scenery -----
I ...
0
votes
1
answer
592
views
NodeJS return value in axios get [duplicate]
I have this class written in javascript but I have difficulty in obtaining the result from the axios request, below my situation to better explain the problem:
i have a file called vtiger.js in the ...
0
votes
1
answer
319
views
Node.js/Axios/Cheerio Web Scraping - issue with Promises
I have an issue with part of my web scraping program. The
return res.send(statsArray) line in index.js always returns an empty array on the initial run (using npm start), and will only return a ...
1
vote
1
answer
602
views
Axios HTTP calls in pipeline without nesting
I need to perform a number of HTTP calls to external API as part of the initialisation of my Node.js back-end (collect data from external API and initialize local data).
Ideally something like this
...
0
votes
1
answer
27
views
Not able to access response from promise function into a variable which can be passed to another function
function getToken()
{
return axios.request({
url: "/xyz",
method: "post",strong text
baseURL: "https://api.testing.in/api/xyz",
...