c# httpWebrequest with proxy works but not curl

≯℡__Kan透↙ 提交于 2019-12-24 10:39:22

问题


I can make a request through a corporate proxy with authentication using c# and httpWebrequest. I could then get the proxy and port used.

Then I tried to use it with curl, wget and rebol and all failed.

For example after creating environment variable http-proxy containing proxy ip and port, I type this command in cmd prompt:

curl --proxy-user login:password google.com

it answers

(6) could not resolve host:google.com

For what reason does http request works for c# and not for others ?


回答1:


Have you tried syntax similar to:

curl -U user:passwd -x proxy:port http://www.stackoverflow.com/



回答2:


The environment variable for a http proxy should be 'http_proxy' (minus the quotes). Note the lower case letters and underscore.



来源:https://stackoverflow.com/questions/6428182/c-sharp-httpwebrequest-with-proxy-works-but-not-curl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!