Questions tagged [npm-request]

npm-request is a node package designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.

npm-request is a node package designed to be the simplest way possible to make HTTP calls. It supports HTTPS and follows redirects by default.

Useful links

158 questions
0
votes
1 answer

node setting this.var inside class async method

I am creating a node js class to use in my app that consumes a restful API. To hit that API I am using the node pckg request. var request = require('request'); class Test{ constructor(){ this.var = {}; } async getVar(){ …
0
votes
0 answers

Request not passing req.body through to other service

I have a Node.js API gateway that passes requests to my different services. It seems to pass the URL correctly (expected) but it is not passing req.body to my other services, in this case my auth service. Here is my route router.post('/signup',…
joshk132
  • 1,011
  • 12
  • 37
0
votes
1 answer

NPM request form keeps returning 415 status

I am trying to make a simple request that was successful in Postman. It's just a POST action with a static URL, Content-Type is application/x-www-form-urlencoded, and two form fields. As simple as this mock example: However, I can't get the same…
NodeMaster
  • 85
  • 1
  • 5
0
votes
1 answer

Node JS connection establishment between two server

In my sample project, I have used Google recaptcha. I need to verify captcha response at back end (Node JS). In NodeJS, I have used request module to connect with google server. But, I got some error like following Error: connect ECONNREFUSED…
Muthukumar
  • 11
  • 7
0
votes
2 answers

How to fix vulnerability in npm dependencies?

I got 18 vulnerabilities by giving npm audit , then i went for the one which is labeled as high. here is its detail, High Denial-of-Service Memory Exhaustion Package qs …
Rio
  • 21
  • 7
0
votes
1 answer

NPM-Request handle on data stop flowing/streaming

I'm piping a CCTV stream using request, and serve it using Express. Sometimes there is problem with network connection in the middle of streaming, that cause in the client picture freeze on the last chunked data. I need to catch this event so I can…
mbeok
  • 29
  • 1
  • 9
0
votes
0 answers

Redirecting when making a POST request

I'm working on this piece of code which makes a POST request to an endpoint and then it should respond back with a simple JSON. here's my code: var businessRulesOptions = { method: 'POST', followAllRedirects: true, url:…
0
votes
1 answer

Failed 401 Unauthorised error displayed in protractor

I am trying to automate the response which is getting generated in the postman tool but getting the error 401 unqutorized error. tried to resolve in many ways by giving the exact security token to the authorization-token but it didnt worked…
DtestA
  • 55
  • 9
0
votes
2 answers

NODE JS - request npm - manipulate url body

I'm working on a server side (self) project with node js (for the first time), and i ran into some difficulties. My goal is the following: first part - Im using "/uploads/processData" URL in my server to get URL(s) from the user request. Now i want…
DXR
  • 25
  • 5
0
votes
1 answer

Cannot POST JSON data into REST server

I am trying to POST some data into a REST server generated via Hyperledger composer. I have a JSON file and I am trying to use NodeJS and the Request module to post. However, it seems like the request module can find my link. This is where I am…
harsh
  • 85
  • 1
  • 3
  • 9
0
votes
1 answer

npm ERROR in package.json file

i have deleted nodeJs ad re-install it again and i used npm cache clean --force and didn't work and i used npm set registry https://registry.npmjs.org/ nothing worked please help me with this if someone fixed the same error before npm ERR! file…
Omar Baz
  • 39
  • 1
  • 9
0
votes
1 answer

npm-request with XHR.withCredentials?

For keeping session information as cookies and having CORS along with it, XHR has withCredentials option along with Access-Control-Allow-Credentials response Header to make the browser send the cookies for each requests. I would like to achieve the…
fahimalizain
  • 844
  • 8
  • 15
0
votes
2 answers

trying to run 'create server' with node.js, how to set up the script files would read with npm start

var fs = require('fs'); var http = require('http'); var ROOT ='./view/index.html'; http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/html'}); fs.readFile(ROOT, function (err,data){ if (err) { …
황정욱
  • 11
  • 3
0
votes
2 answers

Running foundation build fails with an error: TypeError: stream.on is not a function

Working with a new client, their front-end guys send over their setup for the toolchain. They use macosx(Linux) and it works for them. In windows 10 pro, it fails to run the build routine as it should. I have tried for a few days to see what is…
0
votes
1 answer

not able to pipe after data has been emitted from the response npm request

I am using npm request package. In this I can t able to pipe after response is emitted. My code below var fs = require('fs'), request = require('request'); var readStream = request({ url: 'https://www.google.com' }); // wait for 5 seconds,…
Selvakumar
  • 527
  • 2
  • 13