Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how do I set a custom header in a curl config file

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'
like image 835
Galdor Avatar asked Feb 11 '23 12:02

Galdor


1 Answers

-H:"x-abc: xyz" works fine:

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

.....

like image 175
Yuvika Avatar answered Feb 27 '23 02:02

Yuvika