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

Receiving promise from another module in NodeJS with data

I am really new to promises in javascript so I really don't understand what I may be missing in my code. Basically my problem is that in my main program I am trying to iterate through a json array using async.forEachOf and inside that I am calling…
Farooq Khan
  • 305
  • 1
  • 3
  • 10
1
vote
1 answer

Cloudconvert - Invalid signature error when using request-promise to upload via API

I'm attempting to upload a pdf through the cloudconvert API using nodeJS and request-promise. The request to get the upload URL and parameters is successful, but when I attempt to pass the data I get a 401 - "FormPost: Invalid Signature" error, even…
sheltam264
  • 13
  • 2
1
vote
3 answers

Proper way of calling multiple promises asynchronously in javascript

I am new in Javascript so pardon me if my question seems lame to you. What I am doing here is that posting 6 images on Facebook page through Graph-API one after another. So I am calling the POST function with an URL parameter, then when I got the…
Avow Studio
  • 87
  • 3
  • 8
1
vote
0 answers

Can't return value from async function in Node.js but console prints the values

I am new to node.js and I read a few posts about this problem but still don't understand how to solve it in my case. The correct result is printed out, but I want it to be returned or be stored in a variable. Is this possible? const values =…
1
vote
0 answers

How to make an POST REST API call in nodejs using request-promise?

I want to make an API call using REST. Please find my below code. var resp = {}; var pool = {maxSockets: 10} var options = { method: 'POST', port:'yyyy', hostname: 'xx.xx.xx.xx', uri:'https://apiurl/fun', body: { …
sai
  • 487
  • 1
  • 7
  • 16
1
vote
0 answers

ERR_STREAM_WRITE_AFTER_END while using request promise Node Js

I have request promise that use to call another API with few loads here's my request promise here's my container if (!req.uploadedFile2) { opt2 = { method: 'POST', body: { token: req.body.token, …
1
vote
1 answer

How do I mock (request-promise).defaults({ jar: true }) using Jest?

I am trying to write a test that uses a mock implementation of request-promise with defaults set. In my code, I require request using const request = require('request-promise').defaults({ jar: true }); In my test file, I have tried const request =…
Heather
  • 41
  • 2
  • 5
1
vote
2 answers

How do I merge two downloaded arrays into a single JSON array?

I'm pretty new to learning to code. So i might get a lot of basics wrong. Basically i am downloading API content from two different accounts via request-promise and want to merge them into a bigger array. I'm struggling with escaping my local data…
lurf
  • 23
  • 2
1
vote
1 answer

Dialogflow fulfilment using request-promise-native : unable to parse response

I'm performing a REST API call in Salesforce from DialogFlow fulfilment but I just can not read the JSON response. I'd like to access some fields of the JSON response esp CaseNumber. The query can return 0 or several records. Could someone help me…
1
vote
1 answer

Cannot set Koajs' ctx.status and ctx.body when using request-promise

I'm currently coding the manual setup of authenticating a Shopify app, similar to how they set it up in NodeJS and Express. For the application, I'm using NodeJS and the Koa framework. I'm also using @koa/router for routing and attempting to use…
Joseph Woolf
  • 500
  • 5
  • 14
1
vote
0 answers

How to extract an array from a promise (asynchronous) to utilize in synchronous code?

What I want to accomplish: Make a request from a database. Combine the results of multiple columns into one array. Be able to access that array by other functions or methods. I've accomplished #1 and #2 by making all of the requests to the…
ezg
  • 715
  • 2
  • 7
  • 20
1
vote
0 answers

typescript request-promise no overload matches this call

The below code is failing on my request-promise, i already tried cleaning node_modules and installing the dependecies again try { const response = await request(reqOptions) // Error Highlighting `reqOptions`; this.products =…
JEEZSUSCRIZE
  • 174
  • 2
  • 16
1
vote
1 answer

How to use square brackets in nodejs (request-promise)?

it is my first post here, so please forgive me if I did something wrong. So, I need to do a POST request in NodeJS. I choose request-promise for it. Everything was working like a charm until I needed to use square brackets in a key name. So I have…
1
vote
2 answers

using request-promise to querystring in JSON

I have a big API I want to query for userId and receive its details. var options = { uri: 'http://www.theapi.net/0862710324bo0', method : 'GET', useQuerystring: true, qs: { "must": [ …
staminna
  • 468
  • 1
  • 5
  • 26
1
vote
2 answers

cant return the chained promises result

const request = require('request-promise') required this module and use it in this way the data and subData is options that i defined later... const foo= (data, subData) => { return request(data) .then(result => { …
khodekazemi
  • 143
  • 10