Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Mike Chen
@mike442144
because request default follow the redirects
Ruvi Mackinaw
@RuviMackinaw_twitter

Hi,
I have a little problem for whatever reason I am not able to pipe responses to the filesystem.
I am using npm: request-promise-native and my setup is rather simple :

var receivedReq = await request(buildReq);
receivedReq.pipe(fs.createWriteStream("my.html"));

I see the request object full everything is where but he just creates an empty file in the filesystem.
Can anyone give me a hint?

Walle Cyril
@GrosSacASac
let token;
when you have result
token = result;
Ghost
@ghost~5b672562d73408ce4fa391f8
Yeah, I tried that. Something like
let token = null
request(url, (error, reponse, body) => {
token = body.access_token;
}
console.log({token});
@GrosSacASac
Token will be null.
Walle Cyril
@GrosSacASac
you need to think the asynchronous way
your code is not executed line by line in the same order as the lines
Ghost
@ghost~5b672562d73408ce4fa391f8
I know that. That's why I'm asking for help.
I'm trying to have a top level token that can be passed around to the other requests so I don't have to generate one for each request.
it will help you
so you know how to use .then()
use it
raosaqib
@raosaqib
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
image.png
rmargve
@rmargve
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
sm2017
@sm2017
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?
sm2017
@sm2017
@everybody how can I ignore response of POST ?
kivi
@kivi
@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.
Ghost
@ghost~569df964e610378809bd0f27
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
@everybody
Artem Biryukov
@impowski
@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
@jamsden
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
@badepe
Hey, can someone please tell me how I disable sending a Content-Lenght header in request?
Robert
@RobertBroersma
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
@arapoport_twitter
Hi! How do I force request.js to log full requests? Now some parts of the request are obscured by '[Object]' literals...
Taehwa Kim
@Taewa

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 :)
Valentin
@vroussea
hello, is there a way to get json response when using client ?
Valentin
@vroussea
and do you know what is the proper https request in order to authenticate user ?
bloxploits
@bloxploits
Does anyone know how to send a post request with a "Request payload"?
bloxploits
@bloxploits
Nevermind, got it
dev-afzy
@dev-afzy
hy guys iam new here please anyone help me to install request
i got an error while installing the package request/request#3197
violet
@songdangwei
try {
let err = request('http://'+addr,{timeout:300})
options.proxy = "http://"+addr
} catch (e) {
// if(e==='ESOCKETTIMEDOUT'||'ETIMEDOUT'){
if(e.connect === true){
options.proxy = null
}
console.log(e)
}
program is usually shutdowm.What should I do?
program Direct crash of timeout as usually
violet
@songdangwei
A.I. Developer
@8ai
Hope this would be usefull pull request for some participants request/request#3209
Sandip Jadhav
@SandySJadhav
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) {
    alert("error");
});


when Internet connection is down, I am not getting error alert; Can someone help me with this? Thnx 
Ghost
@ghost~5de75f17d73408ce4fd300ae
does this support http2
?