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

Set context in Dialogflow through Promise Request

I am having a problem with the contexts of dialogflow, when trying to change them through fulfillment. When I want to add (or clear, by setting lifespanCount to -1) a context I generally use this code: const {WebhookClient} =…
Nik Erra
  • 35
  • 6
1
vote
0 answers

Turning a CURL request into a Node js format with request-promise

I have been trying to convert a working POST CURL request into Node JS format that i can automate. Im reaching a wall with converting it and hoping someone can help. Here is the curl: curl -POST https://api-xxxxxxxx/add -H "Authorization: Bearer…
Ben Hedges
  • 23
  • 4
1
vote
1 answer

Authorization with API key and password for request-promise

I am trying to make a GET call to the shopify api with request-promise in node. I keep getting this error :- '401 - {"errors":"[API] Invalid API key or access ' + 'token (unrecognized login or wrong password)"}' How should format the options…
twl2009
  • 79
  • 1
  • 11
1
vote
1 answer

Request with request-promise and multipart/form-data

I have to implement the following workflow: Make request no.1, get a JSON response. Manipulate this JSON object so that it can be used as payload in the second request. Make second request. The first request is successfully implemented. I get the…
Lazarus Rising
  • 2,597
  • 7
  • 33
  • 58
1
vote
1 answer

Node Js : Nested API calls: Watch a directory for files, read data from each file and GET an ID from an API, POST the data with the id, in another API

I am trying to, Continuously watch a directory for files, If any file comes in, based on the filetype (inferred from name of file), call a GET api for an ID/key POST the data with the Key in another API. Move the file from which data is posted, to…
Manoj Kumar
  • 811
  • 2
  • 10
  • 22
1
vote
1 answer

Make request with a self-signed cert in js (using request-promise from npm)

I'm making a simple request using the request-promise library, but it errors out because I have a self-signed cert in my chain (which is a requirement, not having it is not an option) with NPM I can specify that cert to install packages (which I've…
Hanny
  • 580
  • 3
  • 16
  • 44
1
vote
0 answers

Encoding issue with request package on Amazon

I use request package, but got no luck on Amazon. The result body is unreadable. The following line is an example of its last…
1
vote
1 answer

Request returns Invalid or nonexistent Content-Type even if I put content-type in header

I'm trying to create an app-managed bucket but am encountering the error: Invalid or nonexistent Content-Type, accepted values are {text/json, application/json} I'm using node.js and request-promise package. The error is confusing to me because I am…
craigbot
  • 345
  • 1
  • 2
  • 15
1
vote
1 answer

Abort await request-promise

Is it possible to abort a request while its pending? Code: var response = await request({uri :”https://www.google.com”}) How would I go about aborting this request?(Not talking about setting timeout)
1
vote
1 answer

Send two post calls using request-promise

I am trying to send, two calls using different urls ( they are not concurrent calls, first one will execute at first and after that second one can execute ). I am using Node 8 and using the request-promise library to have this executed. ( Everything…
Dazzile Pro
  • 253
  • 3
  • 13
1
vote
0 answers

how to populate ${moduleName}, ${value}, ${key} values dynamically in url using requestPromise in node js

I am using request-promise to get data from http url const request = require("request-promise"); const reqData = async url => { try { return await request({ url, json: true }); } catch (e) { log.error(`error in getting data from ${url}`,…
user123
  • 259
  • 2
  • 6
  • 23
1
vote
1 answer

Ionic 4 SQLite "Cannot read property 'then' of undefined" error

I am trying to create an Ionic 4 application, and using SQLite as storage. I've installed the following packages: ionic cordova plugin add cordova-sqlite-storage npm install --save @ionic-native/sqlite ionic cordova plugin add…
1
vote
1 answer

Error: socket hang up in Http Request made in Node JS using request-promise causing for loop to restart

I am trying to make an Http Request using request-promise inside a for loop. But it seems if a Http Request takes long, request-promise closes the connection. This behavior is ok but what I am not able to grasp is the for loop starts from 0 again…
Amit Dube
  • 947
  • 4
  • 10
  • 23
1
vote
1 answer

How do you mock/test requestjs requestcallback with Jest

I am making a get request to an API using requestjs and then in the requestCallBack mapping the body to a custom json object. I am trying to test this code using Jest but no matter how I mock it, it doesn't seem to work I have tried…
Austin Mehmet
  • 448
  • 4
  • 13
1
vote
1 answer

Populating request promise uri with for loop index

I have a series of request that I would like to call in a for-loop. The only thing I am changing in the endpoint is an index parameter. This index parameter should be the same as the index of for-loop(0-100). However the promise return values are…
J.Ting
  • 95
  • 2
  • 10