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

How to install request-promise in angular 9 project

I created a angular 9 project with Angular CLI 9.1.5. I install with npm in this project the request-promise library. I start with : npm i request --save npm i @type/request npm i request-promise --save npm i @type/request-promise When i run this…
cody_code
  • 1
  • 1
0
votes
1 answer

Error: connect ECONNREFUSED 200.142.86.219:443 using google cloud functions appears randomly

I've been trying to make a request using node.js with request-promise library and gCloudFunctions located in US to a webpage located in Brazil. When I get access to it, I login with my data. The problem is that sometimes it works, sometimes it…
0
votes
3 answers

nodejs make request-promise response available for further processing

I would like to use request-promise module and do something with response body. However i am not able to make response available outside request-promise scope. var rp = require('request-promise'); rp('http://www.google.com') .then(function…
0
votes
4 answers

Get CSV File From URL & Convert to JSON Array

I need to get data from a csv file hosted on a url and convert it to json array. Till now I'm using this. import request from "request-promise"; import encode from "nodejs-base64-encode"; let url = 'https://example.com/filename.csv'; …
Shan
  • 948
  • 1
  • 9
  • 17
0
votes
2 answers

How can I get the completed value of an async function when calling a function from index.js?

I'm new to node and I'm trying to create a function to make API requests with pagination. The function successfully gives me the desired output, but I'm confused as to how I can use the .then() function in index.js as it's async. If I use await in…
Yehudah
  • 65
  • 1
  • 5
0
votes
2 answers

I can't seem to figure out why I get 'undefined' after I console.log a value after an async/await function

I'm new to Node JS and I can't seem to figure out why i'm getting an 'undefined' when using an async function. I've wrapped the async function in a promise and it resolves after an API request has been completed. let req = (url) => new…
Yehudah
  • 65
  • 1
  • 5
0
votes
2 answers

Get data from api using request-promise and express

I'm trying to get in response the data stored in my api url. Inside the router, I'm using request-promise to get data from the url. router.get("/", function(req, res) { let uri = 'http://localhost:3000/api/v1/donations'; let _include_headers =…
zakaria mouqcit
  • 393
  • 2
  • 4
  • 17
0
votes
1 answer

How to split many requests to chunks in JavaScript

I have a set of requests but they can not be called all simultaneously so I decided to split the set into the chucks of 10. I am wondering how can I make 10 requests and wait for them all to complete like the example above: data = [] for(mindex = 0;…
chatzich
  • 1,083
  • 2
  • 11
  • 26
0
votes
0 answers

How can I create a loop of fetch based on conditions of result in puppeteer?

I just want to fetch data from multiple urls in a circle loop until the return data is less then the limited number of objects, every url return the array of data object, I would combine all of result in to an postResponse array. let urlsample =…
Khai Dao
  • 55
  • 7
0
votes
0 answers

NodeJS Async-Await function

I would like to make a little translator function which uses the Bing Translator. I could do that and works perfectly, but when i try to call it from my code, and expecting the output I got nothing. I figured out why, because the actual code does…
0
votes
0 answers

My promise in a promise is returning

I have this (extracts): index.js: searchSerial: swName => { return new Promise(async (resolve) => { const url = rawUrl + '?chto=' + swName.replace(' ','+') const $ = cheerio.load(await (await fetch(url)).text()) …
Wxcc
  • 19
  • 10
0
votes
1 answer

Why is my API call not hitting the endpoint? (Typescript, request-promise)

I can't get my API call to hit the endpoint. I have 2 TypeScript projects, one is a list of API endpoints, and the other is a process that will call a series of API endpoints to perform operations. The API endpoint will take a JSON Web token and…
0
votes
0 answers

Nodejs not applying script id value passed to it

I am writing a program in nodejs using the request-promise-native module to create a startup script,receive the script ID then create a server and apply the script ID, however even after gathering the script ID and passing it to the request to…
0
votes
1 answer

Javascript says an object is a string and doesn't allow me to access it's key values (request promise)

it seems no matter what i do with the result it even as it comes back as an object because when I console.log it it prints [object object] however when I check it's typeof it's always a string, no matter what I do, I am trying to do JSON.parse…
makat
  • 154
  • 1
  • 3
  • 14
0
votes
2 answers

request-promise loop, how to include request data sent with response?

I am trying to use request-promise in a loop and then send a response back to the client with all of the responses. The below code works, however I want to also include the request data with each response so that the request ID can be correlated…
user13303450