After the –dump-header writes a file, how to read those headers back into the next request? I would like to read them from a file because there are a number of them.
I tried standard in: cat headers | curl -v -H - ...
I’m actually using the feature in Firebug to "Copy Request Headers" and then saving those to a file. This appears to be the same format.
Since curl 7.55.0
Easy:
… where the header file is a plain text file with an HTTP header on each line. Like this:
Before curl 7.55.0
curl had no way to bulk change headers like that from a file. They had to be modified one bye one with
-H.Your best approach with an old curl version is probably to instead write a shell script that gathers all the headers from the file and use them, like:
Invoke the script like this: