-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request path contains unescaped characters #2046
Comments
Works fine when I do it, using same versions as you: 'use strict';
const request = require('request');
request(
'https://www.crunchbase.com/location/belgrade/2a22cd01619e1ff39394303b255670cb?utm_source=crunchbase_tc_river&utm_medium=export&utm_campaign=dataset',
(error, response, body) => {
if (error) {
return console.error(error);
}
return console.log(body.substr(0, 128) + '...');
}
); Can you post your code? |
I looked into the actual error. |
I work behind a proxy server. Your code does not seem to work behind a proxy. I am pasting my code below. Could you please tell me whether this is the correct way of sending a request while working behind a proxy server. 'use strict';
const request = require('request');
var get_config = function(site_url){
var config = {
url : ((site_url)),
proxy : 'http://proxyhost:proxyport'
};
return config;
};
request(
get_config('https://www.crunchbase.com/location/belgrade/2a22cd01619e1ff39394303b255670cb?utm_source=crunchbase_tc_river&utm_medium=export&utm_campaign=dataset'),
(error, response, body) => {
if (error) {
return console.error(error);
}
return console.log(body.substr(0, 128) + '...');
}
) Also an interesting observation is that when I am replacing "https" with "http", the request is working properly. |
Your proxy doesn't support https then? |
From what I can tell, internally there is some redirect happening, but the redirect seems to have a malformed/bad URL that contains whitespaces, that ticks off this error. If it is a public proxy, could you please post the info? |
Hey @dsaumyajit007 This looks fine and works perfectly with const request = require('request');
var get_config = function(site_url){
var config = {
url : ((site_url)),
proxy : 'http://proxyurl:proxyport'
};
return config;
};
request(
get_config('https://www.crunchbase.com/location/belgrade/2a22cd01619e1ff39394303b255670cb')
, (function (error, response, body) {
console.log(response.statusCode);
console.error(error);
return console.log(body.substr(0, 128) + '...');
})
); For
|
@sudheesh001 Please note that you might be using a different proxy. |
I have a very basic doubt : I am running Node js on Ubuntu 14.04 and on running |
Yes, the 0.x releases are from before the iojs/nodejs merge. I still believe it's just your proxy being weird. |
Ok. Any reason why the link works on repacing "https" with "http" ? It fixes this issue somehow |
Ok Its magically working now. 👍 |
I reinstall request module but it fails after few days to this error agian |
I had the same problem, wonder if people complaining here have another language activated in their keyboards? I do have arabic/english. this might takes us somewhere while investigating |
I am experiencing this issue on windows (ethernet to home network) but not on macOS (wifi to same network). The |
|
在kubernetes环境使用request发送get请求,url中携带中文参数时会发生这个错误,在其他环境则不会 |
I am trying to make a simple GET request to a website : https://www.crunchbase.com/location/belgrade/2a22cd01619e1ff39394303b255670cb?utm_source=crunchbase_tc_river&utm_medium=export&utm_campaign=dataset
I get an error such as this :
Is there any fix to check if the url is compatible to be sent in the request function as a paramater ? I am using request@2.51.0 and node v5.5.0
The text was updated successfully, but these errors were encountered: