I'm trying to use curl to send a HTTP request with custom headers (curl http://example.com -H "Foo: bar"
), and I'm finding that when the header arrives, it has been lower-cased, by curl (the above Foo
header is received as foo: bar
)
How to preserve the case of headers in a request?
Try forcing curl to use HTTP/1.1 - it defaults to HTTP/2, the spec for which states that headers must be in lower case.
curl http://example.com --http1.1 -H "Foo: bar"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With