gpt4 book ai didi

curl - 向服务器发送请求时如何查看curl发出的请求 header ?

转载 作者:行者123 更新时间:2023-12-03 03:55:33 34 4
gpt4 key购买 nike

当我向服务器发送请求时,我想查看由 curl 发出的请求 header 。我该如何检查?

最佳答案

我认为curl --verbose/-v是最简单的。它将吐出请求 header (以“>”为前缀的行),而无需写入文件:

$ curl -v -I -H "Testing: Test header so you see this works" http://stackoverflow.com/
* About to connect() to stackoverflow.com port 80 (#0)
* Trying 69.59.196.211... connected
* Connected to stackoverflow.com (69.59.196.211) port 80 (#0)
> HEAD / HTTP/1.1
> User-Agent: curl/7.16.3 (i686-pc-cygwin) libcurl/7.16.3 OpenSSL/0.9.8h zlib/1.2.3 libssh2/0.15-CVS
> Host: stackoverflow.com
> Accept: */*
> Testing: Test header so you see this works
>
< HTTP/1.0 200 OK
...

关于curl - 向服务器发送请求时如何查看curl发出的请求 header ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/866946/

34 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com