curl - 使用 curl 保留 HTTP 标头的大小写
问题描述
我正在尝试使用 curl 发送带有自定义标头 ( curl http://example.com -H "Foo: bar"
) 的 HTTP 请求,我发现当标头到达时,它已被 curl 小写(上述标头Foo
接收为foo: bar
如何在请求中保留标头的大小写?
解决方案
尝试强制 curl 使用 HTTP/1.1 - 它默认为 HTTP/2,该规范规定标头必须为小写。
curl http://example.com --http1.1 -H "Foo: bar"
推荐阅读
- marklogic - MarkLogic 中是否有用于 PATCH 的 JavaScript 资源扩展?
- kubernetes - Kubernetes Helm Orangehrm HTTPS - 错误请求
- express - 有没有办法修复错误:从插件获取元数据失败并出现错误:invalid_grant: Invalid JWT
- html - 最大宽度不适用于 flexbox+align-items: center
- angular - 如何以编程方式扩展动态添加的垫子扩展面板?
- python - 调用自定义函数时使用 Boto3 Stubber 作为上下文管理器
- java - Java 类在同一个包中(不同的目录),但它们不能互相访问
- angular - 处理一个带来下一个请求的 httpclient 直到完成
- oracle - 外键中的 Oracle 数据库错误消息
- python-3.x - LSTM 为任何输入生成相同的预测