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
0
votes
0 answers

node request-promise doesn't work with pipe() for a POST request with body

My service dispatches a POST request with some body coming from one service to another. Existing implementation works for GET request: var rp = require('request-promise'); public pipe(options: Options, req: Request, res: Response): void { …
limak111
  • 21
  • 1
  • 3
0
votes
1 answer

script time out with executeAsyncScript() for fetch post call

I am trying to run a script using executeAsyncScript() method having a fetch call. since fetch call returns a promise, hence on console it is taking some time to fulfill the promise but using selenium java script executer it is throwing error saying…
0
votes
0 answers

Unable to establish an https connection to remote server which uses self signed certificate using with Node.js

I am not able to connect to a remote server which uses self signed certificate from node.js. Following is the code to connect: var rp = require('request-promise'); var fs = require("fs"); var options = { method: 'POST', uri:…
Namrata Kumari
  • 158
  • 1
  • 13
0
votes
1 answer

cannot consume content type Rest API Response from Amazon Advertising API

I am hitting the /sb/negativeKeywords endpoint and every time I try to make a POST request, I get the following error: StatusCodeError: 415 - {"code":"415","details":"Cannot consume content type"} Notice that the documentation asks for a media type…
0
votes
3 answers

Promise.all not waiting to complete the requests

await Promise.all( endpoints.map((endpoint) => this.httpService.get(endpoint).pipe( map((response) => { return response.data['result']; }), ), ), ).then( axios.spread((...allData) => { allData.forEach((res) => …
qwerty
  • 9
  • 1
  • 7
0
votes
1 answer

Getting "undefined is not an object" on a validated array

I'm trying to access an array inside of an object that comes in a response: getMatches().then((matches) =>{ let possibleDraws = [] console.log(matches) console.log(typeof matches) matches.forEach(match => { if(isPossibleDraw(match)){ …
0
votes
1 answer

Promise not returning resolve from express app.get Nodejs

I'm trying to return a resolve or reject depending on if the promise was successful or not. I can't seem to figure out why this isn't returning the response. All I get from my promise is [object Object]. This is what I get in response. Here's the…
LOGIC12
  • 41
  • 2
  • 8
0
votes
1 answer

Rick & morty API REACT

I am using rick & morty API, and i want to render cards of the result where I display name, gender, location & episode name. But the object returns this. > "results": [ { "id": 19, "name": "Antenna Rick", …
Jose A.
  • 483
  • 2
  • 7
  • 15
0
votes
2 answers

How to do complex logic in a Promise `then` clause? The request-promise syntax itself appears problematic

I'm running my javascript code with node.js and am using the request-promise library to generate https requests which return a json blob. So far, I've managed to send the request correctly--and I do receive the desired json object in the response,…
Wulf
  • 379
  • 1
  • 6
  • 16
0
votes
1 answer

Stubbing a specific API request inside a function

How do I individually implement stubs to functions invoked inside a parent function? Assuming I have these functions (req1,req2...) that are HTTP Requests from external services that are all returning differing values, is there a way where I can…
RoboKy
  • 141
  • 1
  • 10
0
votes
1 answer

Promise.all() works well in debug mode, but not working in release mode of react native project

I am developing a react native project for mobile applications. The app works fine in debug mode but doesn't work properly after I release the app with CLI. I think the API request part in Promise.all() inside the code below has an issue in release…
0
votes
1 answer

Detect if promise contains data in nodejs express

I have a nodejs application that returns a promise. I need help with determining if the promise "result" contains data or if its an empty array. I have tried using Object.keys(result).length === 0 but unfortunately was unsuccessful. Any advice will…
tim67
  • 15
  • 3
0
votes
1 answer

Possible open a connection to a private repository via HTTP request?

Since Github API didn't support get the branch contains commit (SHA) yet. So I found we can get the branch if we can parse HTML from URL https://github.com/:org/:repo/branch_commits/:sha. But currently, I can't connect to this URL (for a private…
Iris Louis
  • 297
  • 6
  • 19
0
votes
1 answer

Using Mongoose save() inside Formidable's parse() inside NextJS API

Am using formidable package and mongoose in my NextJS app. So I wrote the API call to allow user to upload a photo along with some data. And I process the files using the formidable and it's working fine. But after processing the file, I need to…
Vpp Man
  • 2,384
  • 8
  • 43
  • 74
0
votes
1 answer

Coinmarketcap widget is not responding to request

I was using this code to get data of the currency like price, market cap etc... I'm preparing new bot and the request is not working due api error... Code: 'use strict'; const rp = require('request-promise'); const requestOptions = { method:…
RasmonT
  • 391
  • 2
  • 13