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.js Promise concurrency

I am getting a weird unexpected output that I can't explain. knowing that I am using Node.js and MongoDb, take a look at this code below (i): is supposed to be faster then this code below (ii): but weird enough I get this output in the…
0
votes
1 answer

How to convert request-promise get Request to Axios get Request

This is my request-promise get Request Code I want to convert this code to Axios get Request let file = rp.get({ uri: "url", headers: { "Accept": "message/rfc2822" } }).auth("api", "ap`enter code here`i-key") /**Access the buffer…
0
votes
1 answer

JavaScript async function returns object Promise

I'm trying to figure out, how to return from JavaScript async function. In Node.js application script.js I have a function: let result = getresult(input); must be async function with /content tag in await fetch to insert, send msg: input value…
emss
  • 65
  • 9
0
votes
0 answers

get JSON string as response using 'request-promise' without the library parsing the body and returning as JS object

I am using 'request-promise' library for HTTP requests, and I have been searching for a way to get the JSON string directly without the library parsing the response body and sending me the JS object. It is due to the JS object I am receiving it…
0
votes
1 answer

Proper way to send post request using Promise

I dont know if I am properly using the promise, the problem here is that sending request is too long. This is my current code exports.updatePostApi = async (datas) => { return new Promise(async (resolve, reject) => { setTimeout(async () => { …
denise
  • 15
  • 6
0
votes
1 answer

scraping using cheerio returns empty array

I am trying to scrape a website https://buff.163.com/market/csgo#tab=buying&page_num=1 using request-promise and cheerio. my entire code is below : const request = require('request-promise'); const cheerio = require('cheerio'); const url =…
0
votes
0 answers

How to handle FlushBuffer response from Java controller in typescript

I have a typescript client which calls one Java API which executes functionA and use response.flushbuffer() to send the first response back to client. After that, in the same controller executes functionB and then returns the response. I want to…
0
votes
1 answer

JavaScript - result undefined - forcing one method to complete before another?

I have the following NodeJS code running in an AWS Lambda: const https = require('https'); exports.handler = async event => { try { const currentWeekNumber = getWeekNumber(new Date(Date.now())); const currentTournamentId = await…
java12399900
  • 1,485
  • 7
  • 26
  • 56
0
votes
2 answers

Can't seem to get value from cy.request but I can console.log the value

I am trying to call an endpoint using cypress and get a value out form the JSON body. I am able to console.log(response.body.data.invitationCode) out fine but can't seem to assign that value to a variable (I want to pass that value to subsequent…
Orbita1frame
  • 203
  • 4
  • 13
0
votes
1 answer

Which order does this execute in? (Promises, javascript)

So I am working with promises and async/await for the first time. From my understanding async makes a function asynchronous and allows other functions to be executed while it awaits a response from a query etc. We were given the following code as an…
0
votes
3 answers

How to refractor promise code for cypress

import SignInPage from '../pages/signInPage.cy' import ValidateAccountPage from '../pages/validateAccountPage.cy' import DeptPage from '../pages/deptPage.cy' import HomePage from '../pages/homePage.cy' import DeleteAccount from…
0
votes
0 answers

How to make several requests in a loop and wait for one to finish before doing the next one in javascript?

I want to make several async request in a loop, but I dont know how to do for pause the current loop until the current request is finished. I tried with a await but it doesnt work, the loop still continues the normal flow, and dispatch the request…
0
votes
1 answer

The images refused to display

The image refused to show it kept on showing me the same error: net::ERR_BLOCKED_BY_RESPONSE.NotSameOriginAfterDefaultedToSameOriginByCoep 307. I am fetching them from https://forkify-api.herokuapp.com/api/v2/recipes?search=pizza. Any help or way…
0
votes
0 answers

How should I handle my response from the error on NODEJS?

I am trying to use a username and password to login in website and get the session token. The username and password actually works and it logins in the system but the problem is that the session token shows inside the error response. Is it a good…
Angels
  • 325
  • 4
  • 15
0
votes
0 answers

Why JS Spread not cloning response headers?

Using request-promise npm, made an GET call to an website url. Request contains const response = await requestPromise({ url: url, headers: { 'User-Agent': '', }, encoding: null, resolveWithFullResponse: true …