Answer the question
In order to leave comments, you need to log in
Asynchronous request and promises?
Good afternoon! Please tell me where am I wrong? why is the promise empty, well, as if the result is not waiting.
let dfd = vow.defer();
const options = {
url: 'http://www.part-kom.ru/engine/api/v3/search/parts',
headers: {
'Authorization': 'Basic ' + login,
'Accept': 'application/json',
'Content-type': 'application/json'
},
qs: { number: '1111' },
json: true
};
rp(options)
.then(result => {
dfd.resolve(result);
});
return dfd.promise();
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question