如何在显示对话框要求身份验证的网站上使用curl

时间:2012-09-10 15:40:12

标签: http curl

curl http://example.com

返回HTTP 401错误,

当我在浏览器中打开http://example.com时显示:

enter image description here

如何通过curl

输入用户名和密码

注意:

我根据其中一个答案尝试了这个,我得到了同样的信息:

curl --user myuser:123456 http://example.com
401 Unauthorized

解决方案

我刚刚添加了“--ntlm”,它确实有效!

curl --user myuser:123456 http://example.com --ntlm

我会选择最近的答案......

1 个答案:

答案 0 :(得分:1)

你试过了吗?

curl --user name:password http://www.example.com