卷曲 - 用户验证/密码中的感叹号

Mic*_*ICE 34 bash curl escaping

有CURL和HTTP用户和密码Auth方法的问题,它不喜欢感叹号,我试图逃避以下方式:

试过但失败了......

/usr/bin/curl -u 'UserName\WithSlash:PasswordWithExclamation!' https://test.com/
/usr/bin/curl -u UserName\\WithSlash:PasswordWithExclamation\! https://test.com/
Run Code Online (Sandbox Code Playgroud)

如果重要的话,不使用基本或摘要(使用--anya)...得到401拒绝...

我做错了什么?

piz*_*zza 43

 curl -u UserName\\WithSlash:PasswordWithExclamation\!  http://....
Run Code Online (Sandbox Code Playgroud)

工作良好.

它发送

 GET / HTTP/1.1
 Authorization: Basic VXNlck5hbWVcV2l0aFNsYXNoOlBhc3N3b3JkV2l0aEV4Y2xhbWF0aW9uIQ==
 User-Agent: curl/7.21.0
 Host: teststuff1.com:80
 Accept: */*
Run Code Online (Sandbox Code Playgroud)

这是"UserName\WithSlash:PasswordWithExclamation!" 在auth字符串中.