我正在尝试使用curl在我的命令行中调试一个传出的GET HTTP请求。
curl --header "Authorization: Basic AAABBBCCCCDDDEEFFF=" https://myserver:8443/user?id=9829878 -vvv输出日志没有显示我之前设置的"Authorization“头:
* Trying 10.30.215.211...
* TCP_NODELAY set
* Connected to (nil) (10.30.215.211) port 3128 (#0)
* Establish HTTP proxy tunnel to myserver:8443
> CONNECT myserver:8443 HTTP/1.1
> Host: myserver:8443
> User-Agent: curl/7.52.1
> Proxy-Connection: Keep-Alive
>
< HTTP/1.0 403 Forbidden
< Server: squid/3.1.23
< Mime-Version: 1.0
< Date: Mon, 09 Apr 2018 19:16:00 GMT
< Content-Type: text/html
< Content-Length: 3207
< X-Squid-Error: ERR_ACCESS_DENIED 0
< Vary: Accept-Language
< Content-Language: en
< Connection: keep-alive
<
* Received HTTP code 403 from proxy after CONNECT
* Curl_http_done: called premature == 0
* Closing connection 0
curl: (56) Received HTTP code 403 from proxy after CONNECT我的curl请求中有没有设置头部内容的错误?
发布于 2018-04-10 17:27:27
首先,curl尝试建立到代理的连接,但失败了,因此它永远无法发送--header标头。如果要将标头发送到代理,而不是目标,请使用--proxy-header而不是--header。如果要将标头同时发送到两者,请同时使用--proxy-header和-header。
https://stackoverflow.com/questions/49740177
复制相似问题