72
rated 0 times
[
78]
[
6]
/ answers: 1 / hits: 23978
/ 9 Years ago, thu, september 24, 2015, 12:00:00
Is there a limit to the size when making HTTP GET requests in Node.js? And if so, how can I change this?
var url = ... // very long, ~50'000 chars
http.get(url, function (res) {
res.pipe(fs.createWriteStream(file.txt));
});
Gives me this:
<html><body><h1>400 Bad request</h1>
Your browser sent an invalid request.
</body></html>
Same thing using wget in PowerShell or Bash works perfectly fine.
$url = ...
wget -outf file.txt $url
More From » node.js