2012-07-12 55 views
18

拥有的卷曲度和HTTP用户名和密码验证方法的问题,它不顺心的感叹号,我试图逃跑以下几种方式:卷曲 - 感叹号在用户认证/密码

尝试和失败...

/usr/bin/curl -u 'UserName\WithSlash:PasswordWithExclamation!' https://test.com/ 
/usr/bin/curl -u UserName\\WithSlash:PasswordWithExclamation\! https://test.com/ 

不工作的基本或摘要,如果它的事项(使用--anyauth)......让401否认...

我在做什么错误?

+0

出于好奇,您是否尝试过使用用户名并让curl提示输入密码,或者使用'--netrc' opt并将用户名和密码放在.netrc文件中? – kojiro 2012-07-12 03:01:14

+0

我现在就试试这些,谢谢。 – MichaelICE 2012-07-12 03:14:51

+0

.netrc正在寻找工作到目前为止... – MichaelICE 2012-07-12 03:24:40

回答

28
curl -u UserName\\WithSlash:PasswordWithExclamation\! http://.... 

工作正常。

发送

GET/HTTP/1.1 
Authorization: Basic VXNlck5hbWVcV2l0aFNsYXNoOlBhc3N3b3JkV2l0aEV4Y2xhbWF0aW9uIQ== 
User-Agent: curl/7.21.0 
Host: teststuff1.com:80 
Accept: */* 

这是 “用户名\ WithSlash:PasswordWithExclamation”在auth字符串中。