Help with a function in node.js

Fermé Publié le il y a 7 ans Paiement à la livraison
Fermé Paiement à la livraison

Hi need help to make a function async in node.js

[login to view URL]

in the function i need to get x = response body before return

Right now it just returns ""

JavaScript Node.js

Nº du projet : #11590079

À propos du projet

20 propositions Projet à distance Actif il y a 7 ans

20 freelances font une offre moyenne de 24 € pour ce travail

arifjaunpur

You need to understand nature of javascript which is asynchronous that means your return statement do not wait to complete the request made by unirest, You should either use callback function or promise.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(123 Commentaires)
6.9
FreelanceDragon

Hey there! :) As your code's written right now, it's definitely going to be returning x before it has the chance to set it. The easiest way to fix this would be with either callbacks or promises; I would probably re Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(20 Commentaires)
5.2
probal31

Hi, I have solved your problem. It's working now. I am able to get the results in the result array. Ping me back so that I can show you a demo. Thanks.

€24 EUR en 0 jours
(15 Commentaires)
5.0
harilalrafaliya

A proposal has not yet been provided

€34 EUR en 2 jours
(22 Commentaires)
3.8
idietmoran

In node you should get used to passing things to callbacks instead of running things async. I can show you how to do it. You can also use ES6 generators if you want it to wait for a value, or promises.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(0 Commentaires)
0.0
KleinMaximus

Hello. I know, how to fix the error. I even already did it. If you choose me, I will explain what the problem is. What Node.js version are you using? For now, I work more for feedback, rather than money. You Plus

€12 EUR en 0 jours
(0 Commentaires)
0.0
ashishkumar148

I have been working in the nodeJS for last 2 years. I have written a lot of APIs using async package which is very similar to your requirement. If i get this project this will be my first project that why i am bidding Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(0 Commentaires)
0.0
EMarkosov

Hello. Need to write asyncronous code in order to complete such tasks. Will do it in several minutes.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(0 Commentaires)
0.0
hasrama

Hi there, I have gone through your job-posting and become very eager to work with you. I am a hard worker and very punctual. My main goal is to gain my client's satisfaction by completing the job with 100% accurac Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(0 Commentaires)
0.0
antonlebiodkin

I could do it with making your request synchronous But in general you should use callbacks and promise objects to return data from async call. Good luck!

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% EUR en 1 jour
(0 Commentaires)
0.0
damenspike

I have a lot of experience in asynchronous programming in Node.js. I understand the problem, I've solved similar issues before in my own work.

€14 EUR en 0 jours
(0 Commentaires)
0.0