Questions tagged [request-promise]

NodeJS simplified HTTP request client 'request' with Promise support. Powered by Bluebird.

NodeJS simplified HTTP request client 'request' with Promise support. Powered by Bluebird.

Resources

Also check out the new libraries that are very similar to request-promise v4:

363 questions
1
vote
1 answer

Cheerio Scraping with Bluebird Promise

Why this code is not working? I get TypeError: $ is not a function test.js 'use strict'; var Promise = require('bluebird'); var request = require('request-promise'); var cheerio = require('cheerio'); module.exports = { get: function () { …
Jumpa
  • 4,319
  • 11
  • 52
  • 100
1
vote
1 answer

Request-promise API call not updating variable as expected in React app

I have the following IIFE in a React app: const GetFeedData = (function () { let feed, feedId; return { getFeedId: function (sub) { switch (sub) { case '1': case '2': case '3': case '4': case '5': case…
bkula
  • 541
  • 3
  • 10
  • 22
1
vote
1 answer

Invalid await in RequestPromise

I've got a TSLint error which says "Invalid 'await' of a non-Promise value." for the following line: const response: RequestResponse = await this.apiRequest(uri); Context code: private apiRequest: RequestAPI
kentor
  • 16,553
  • 20
  • 86
  • 144
1
vote
1 answer

Request-Promise-Native ignores specified headers

I am somewhat new to Nodejs. I am working on a pair of Microservices, and I need one to post data to the other. I am using the request-promise-native library. My code is to make the call is like this: const options = { method:…
Danny Ellis Jr.
  • 1,674
  • 2
  • 23
  • 38
1
vote
2 answers

NodeJS / request promise : the promise is resolved automatically

I use the request-promise node module as following : let rp = require('request-promise'); I have the following promises chain : getData().then( data => { return getUser(data); }) .then( data => { return getProfiles(data); }).then( data => { …
Dae
  • 11
  • 3
1
vote
1 answer

Unit test request-promise, promise() is not a function

I am trying to unit test this function with sinon/mocha which uses request-promise. I attach the .promise() to allow access to all the Bluebird promise methods. According to the request-promise readme: rp(...).promise() or e.g.…
cusejuice
  • 10,285
  • 26
  • 90
  • 145
1
vote
1 answer

Nested Promise not pushing to array

I have a route on an Express API, that requests an artists details, this response contains an array of releases for that artist. Currently I'd like to map over that array, extract a url and then make an API call to that url. The response I get back,…
Harry Blue
  • 4,202
  • 10
  • 39
  • 78
1
vote
1 answer

Firebase HTTPS Cloud Function Triggered Twice

I've read through the Firebase Cloud Functions reference, guides and sample code to try and determine why my function is triggered twice, but am yet to find a successful resolution. I've also trialed Firebase-Queue as a work-around, however its…
1
vote
3 answers

Node JS: chaining promises which are using promises

I need to chain promises which are using request promises, so it is kinda chaining nested promises. Imagine the code: const rp = require('request-promise'); function doStuff(){ for ( let i = 0; i <= 10; i++ ){ methodA(); } }; function…
Kirill Linnik
  • 91
  • 2
  • 9
1
vote
1 answer

request-pormise - bad post request to server with port

I try use promise-request and write code: var pr = require('promise-request'); var options = { method: 'POST', uri: 'http://localhost:4000/user/login', port: 4000, form: { login: 'login', password: 'password' }, json:…
1
vote
1 answer

How to make async api call with Node.js?

I have this problem with node.js, I'm using the node --trace-sync-io when starting my application and when I make api call on my server.js file using the request module and request-promise module, it still warns that I'm using Sync API and points to…
Quartal
  • 410
  • 3
  • 14
1
vote
2 answers

Can print out an object, but cannot access its values in JS

I know this will be a very stupid question, but I've been pulling my hair out trying to figure this out. I'm getting the following response back from an API I'm using: { "item_id": "51c3d78797c3e6d8d3b546cf", "item_name": "Cola, Cherry", …
ScaVenGerS
  • 61
  • 1
  • 10
0
votes
0 answers

User not found in channel (AgoraSDK RTC v4)

You can see the problem in the screenshots. I'm trying to create a channel for 2 people using Agora, but when I try to connect I only get the local stream connection to work. The remote user can't be seen or heard and I get errors in the…
0
votes
0 answers

Handling redirect response from Spring Security in Node server with request-promise

I am working on o365 integration, i'm intercepting O365 redirect call in one backend service(A -> node app) and then sending it to other backend service(B -> spring app) where spring security handles all the token and redirect to URL using…
0
votes
0 answers

Looping while receiving data from async request module

I am a newbie in Node.JS. I am trying to fetch data from an api and filtering out data from a miscellaneous response. But my while loop is getting into infinite loop as the res array never gets populated due asynchronous behavior of request. let…