Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
it will help you
so you know how to use .then()
use it
I am very much new for API automation. I am planning to use request module with type script along with Mocha
I already have my UI framework on protractor/type script with mocha
can anybody help me to start with API Automation
I am facing the issue
I want to store a cookie received from 'post request' and send it on 'get request'. how can i do it?
setting jar: true in request did not help
Hello , I have a security/performance question , I want to POST to a callback url , the callback url is a url come from end-user , And it can be dangerous for our server , I want to POST a json to the callback url (Hooks), I WANT TO BE SAFE, I set 10 seconds timeout , but I am worry about response , malicious user can send 1TB response and I can fail our server , or may be some other consideration that I am umware , I validate url to have tld to prevent localhost calls
How can I ensure safty? How can I ignore response?
@everybody how can I ignore response of POST ?
@sm2017 I guess you are programming a client and a server? The client uses request, right? What does the server use? I can imagine that you could limit the body of the request on both sides.
If you have an nginx in front of your node, then you could set the limit there. Or express in node has also a limit setting on bodyParser. depends what you are using server side... or you have a stream, if you process large data, mesure it and drop it if it get's too large.
Hey just looking for some help, when I run a loop containing a GET request I seem to use a lot of memory. Possibly someone here could help with my issue? I posted a thread on Stack Overflow and in the example used axios although the issue was still present when I used request.js https://stackoverflow.com/questions/54902051/node-js-api-request-loop-without-a-memory-overload
Artem Biryukov
@everybody I have multiple separate requests and each one of them is dependent on another, my problem is that cookie are not preserved on each of them.
Jim Amsden
Is there any convenient way to support JEE form based authentication? Does request.js support registration of request and/or response interceptors that could be used to handle such an authentication challenge?
Christopher Deli
Hey, can someone please tell me how I disable sending a Content-Lenght header in request?
Hey! I'm using request to upload a file to a signed url in AWS S3 using formData: { [name]: fs.createReadStream(filePath) }. Everything seems to work fine, however it adds ----------------------------237294480337614270082104 Content-Disposition: form-data; name="name.html"; filename="name.html" Content-Type: text/html to the top of every file, which shows when displaying the html file somewhere else, and makes video files unusable. Why is it adding this? Is this something with request?
Andrej Rapoport
Hi! How do I force request.js to log full requests? Now some parts of the request are obscured by '[Object]' literals...
Taehwa Kim

Hi all,
It might be a silly question but I don't know how to debug RequestJs.
Of course I checked readme on https://github.com/request/request#debugging

  1. Launch the node process like NODE_DEBUG=request node script.js (lib,request,otherlib works too).
  2. Set require('request').debug = true at any time (this does the same thing as #1).

I am newbie so I don't understand none of them but I tried number 2.
But I don't know where to check logs.

What I'd like to do is to see http request (including header) when I use request.post(...).
Any help would be appreciated!

Because when I tested http call on curl, it worked, but not on requestJs.
So I'd like to see what am doing wrong :)
hello, is there a way to get json response when using client ?
and do you know what is the proper https request in order to authenticate user ?
Does anyone know how to send a post request with a "Request payload"?
Nevermind, got it
hy guys iam new here please anyone help me to install request
i got an error while installing the package request/request#3197
try {
let err = request('http://'+addr,{timeout:300})
options.proxy = "http://"+addr
} catch (e) {
if(e.connect === true){
options.proxy = null
program is usually shutdowm.What should I do?
program Direct crash of timeout as usually
A.I. Developer
Hope this would be usefull pull request for some participants request/request#3209
Sandip Jadhav
Hello, I need one help.I am using request module for downloading a file.
myrequest = request({
    method: 'GET',
    uri: file_url,
    headers: {
        range: ("bytes=" + bytes + "-" + totalSize)
}).on("error", function(err) {

when Internet connection is down, I am not getting error alert; Can someone help me with this? Thnx 
does this support http2
Werd Bmocsil
Greetings, I'm having difficulty getting request.post() to send a fileStream in `multipart/form-data', something like this:
let s3FileStream = s3.getObject(s3ObjectLocation).createReadStream();
let sender = "bob";
let receiver = "steve";

let formData = { "To": sender,
"From": receiver,
"file": s3FileStream };

        url: theURL,
        formData: formData,
        auth: {
            user: theUserName,
            pass: thePassword
If "file" in formData is a string, it sends just fine.
but when set to s3FileStream as shown above, I get an HTTP 400 BAD REQUEST
Werd Bmocsil
Also, when I replace s3FileStream with a ReadStream from fs, it works as expected.
const fs = require('fs');
s3FileStream = fs.createReadStream('/tmp/s3TestInput.txt');
so, my question is:
Should request.post(...) work when setting a formData value to return from an S3.getObject().createReadStream()
Werd Bmocsil
I think I found the problem.
request appears to require fields readable, path, and modefor isReadStream.
Unfortunately, while the value of s3.getObject(s3ObjectLocation).createReadStream() has readable, it has nothing for path or mode.
So I can’t use the two together directly.

it seems like a test for method .pipe() would be sufficient.

Like in axios: https://github.com/axios/axios/blob/master/lib/utils.js#L149

Conor Reid
Hey, any good HTTP2 libraries for node?
that have proxy support too
Hi I'm new to this
How to resolve this? npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142