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
1 answer

Nodejs request-promise combining json api data from 2 links?

const express = require('express'); const app = express(); const path = require('path'); const config = require('./config.json'); const moment = require('moment'); const request = require('request-promise'); url =…
0
votes
2 answers

Saving a JSON file outside of a async fetch function

Why does the console.log(jsonData) within the async function return the json object in the format I want, and the console.log(jsondata) outside the async function return a message saying Promise { < pending> }. How do I save the JSON file that I…
0
votes
1 answer

Execute async request inside .map loop in correct order

I'm struggling with .map loop and async function inside. I use request-promise for async requests. import * as rp from 'request-promise'; const testArray = ['one', 'two', 'three']; const link = 'https://somelink.com/'; const test =…
0
votes
3 answers

Implementation problems while using React's Promises

I'm working on an assignment where I need to implement an order management system. The problem is that I need to make a GET call to get all the orders, and for each order I need to make another GET call so I can get the Items of this order. My…
0
votes
1 answer

How to use multiple promises in recursion?

I am trying to solve the problem where the script enters a website, takes the first 10 links from it and then goes on those 10 links and then goes on to the next 10 links found on each of these 10 previous pages. Until the number of visited pages…
Marcin Warzybok
  • 357
  • 4
  • 16
0
votes
0 answers

How to return a global string from a function?

I'm a beginner of nodejs . I have a Https api, and I use it via request-promise. How to return a global variable from this function? Here is my code: import rp from 'request-promise'; let options = { uri:…
0
votes
0 answers

Why does my request-promise function work in Chrome but not Firefox or Safari?

I'm trying to use a script for a webpage that scrapes and then parses an RSS feed using request-promise. From what I understand, request-promise has to run server-side, so I'm calling the script externally in my html. I've been using…
0
votes
1 answer

Uploading a file by multi-part/form-data usig request promise in reatjs

I am trying to upload a file in reactjs inside an input HTML tag onFileUpload(e)} type="file" caption="File1" />; Then the onFileUpload is as…
Mahi
  • 97
  • 2
  • 9
0
votes
1 answer

Javascript Promises: fetch .then retrieving [[PromiseValue]]

I'm trying to retrieve the [[PromiseValue]] of a Promise. My function currently returns a Promise instead and the value I want myFunction to return is the value stored in [[PromiseValue]] of the returned Promise. This returns a…
CS_Newbie
  • 17
  • 2
  • 7
0
votes
1 answer

Unable to reinitialize and return error Response from my catch statement

In my lambda node code, I am trying to make a call to my SQL DB and retrieve my data. I am using promises and am able to get the data successfully. However, I am not able to implement error handling as per the requirements. My requirements are that…
Aditya P
  • 19
  • 1
  • 9
0
votes
1 answer

How to fix strange loop iteration when using npm request-promise?

I have been trying to get some data from a website into my NODE application using web-scraping. The data looks to work alright although there are strange operations in the for loop I have created. ISSUES I'm facing: Iterations are not…
Loizos Vasileiou
  • 674
  • 10
  • 37
0
votes
1 answer

How to call async function inside request-promise object?

I have a function given below: var request = require('request-promise'); var gzipEncoding=require('./gzipClass'); (async()=>{ request({headers:{"Accept-Encoding": "gzip"},uri:"https://www.giftofspeed.com/gzip-test/", method: 'HEAD'}, function…
anna
  • 405
  • 5
  • 13
0
votes
4 answers

How can I use a for loop to reiterate a promise function?

I have the following code that is used to get JSON data from an Amazon Web Server API. var json1 = new Promise((resolve, reject) => { fetch(url[0]) .then(r => { resolve(r.json()) }) .catch(err => { reject(err) …
BMW
  • 35
  • 7
0
votes
1 answer

RP - Posting formdata not passing correctly to service

I need to pass file with formdata and server written in java should receive as below public Response uploadFileWithMetadata(ObjectMetadata objectMetadata, MultipartBody multipartBody) {} below is the client code and I am passing which is sending as…
MohanSee
  • 83
  • 1
  • 10
0
votes
1 answer

How can I use proxies in Request-Promise requests?

I'm trying to use a HTTP proxy file, choosing a random proxy for each request, then requesting using the request-promise library. const rp = require('request-promise'), fs = require('fs') var proxies = [] function sendR() { let proxy =…
Cooper
  • 47
  • 2
  • 10