卷曲结果给出了特殊的字符

时间:2014-11-30 06:12:50

标签: curl

我发送如下格式的curl语法来获取授权码值

D:\>curl -k "https://login.mailchimp.com/oauth2/authorize-post" -H "Host: login.mailchimp.com" -H "User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" -H "Accept-Language: en-US,en;q=0.5" -H "Accept-Encoding: gzip, deflate" -H "Referer: https://www.httpsnow.org/?code=fa4b17caac5cdef9d6a88250d320a9b5" -H "Content-Type: text/plain; charset=UTF-8" -H "Origin: https://www.httpsnow.org" -H "Connection: keep-alive" -H "Pragma: no-cache" -H "Cache-Control: no-cache" --data "username=mailchims&password=Mailchimp"%"403" 

卷曲:(6)无法解析主持人:login.mailchimp.com

D:\>curl -k "https://login.mailchimp.com/oauth2/authorize-post" -H "Host: login.mailchimp.com" -H "User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:33.0) Gecko/20100101 Firefox/33.0" -H "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8" -H "Accept-Language: en-US,en;q=0.5" -H "Accept-Encoding: gzip, deflate" -H "Referer: https://www.httpsnow.org/?code=fa4b17caac5cdef9d6a88250d320a9b5" -H "Content-Type: text/plain; charset=UTF-8" -H "Origin: https://www.httpsnow.org" -H "Connection: keep-alive" -H "Pragma: no-cache" -H "Cache-Control: no-cache" --data "username=mailchims&password=Mailchimp"%"403"

▼♥☻♥ d产品:>

获取结果集时如何避免使用特殊字符?在上面的输出中,您可以在底部看到爱情符号。如果我做错了,请纠正我的sysntax

2 个答案:

答案 0 :(得分:0)

似乎结果是一个gzip,因此你会看到特殊字符。您可以将其保存在文件中,并使用静音设置禁用屏幕中的任何内容。

将以下内容附加到您拥有的curl命令行:

-o [filename] --silent

将[filename]替换为文件名以保存响应。

答案 1 :(得分:0)

curl --compressed
--compressed
  (HTTP) Request a compressed response using one of the algorithms libcurl
  supports, and save the uncompressed document. If this option is used and the
  server sends an unsupported encoding, curl will report an error.

How to properly handle a gzipped page when using curl?

explainshell.com