如何在curl配置文件中设置自定义标头 [英] how do I set a custom header in a curl config file
本文介绍了如何在curl配置文件中设置自定义标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在curl配置文件中添加用于设置自定义标头的选项?
以下两行都不起作用:
How do I add the option for setting a custom header in a curl config file? Neither of the following lines did work:
Header = 'x-abc: xyz'
header = 'x-abc: xyz'
推荐答案
-H:x-abc:xyz
工作正常:
curl -vvv -K headerfile http://www.google.com -o /dev/null
* About to connect() to www.google.com port 80 (#0)
* Trying 74.125.230.243...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* connected
* Connected to www.google.com (74.125.230.243) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl
> Host: www.google.com
> Accept: */*
> x-abc: xyz
.....
这篇关于如何在curl配置文件中设置自定义标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文