-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headers case #402
Comments
In this case, the only solution is to fix the servers to follow the HTTP spec that headers are case-insensitive. |
Hello, I assume that it is possible to use the option implemented in hyper with If we could introduce this field in the reqwest client builder (in Maybe something like this:
I could do a PR for this. WDYT? EDIT: After a few tests with this field, it is possible to send case sensitive headers. |
Hello, This has been merged here: #463 |
is this PR compatible with reqwest at all or do I have to start using hyper? |
@toovs I'm sorry, what do you mean? This added the following option: https://docs.rs/reqwest/0.9.*/reqwest/struct.ClientBuilder.html#method.http1_title_case_headers |
thanks for the link, I was reading an older version of the docs for some reason. |
I'm still getting a panic when using capitalization with |
|
I'm trying to interface with twitch.tv's api and I need to send the "Client-ID" header, so I guess it's incorrectly sending "Client-Id" if it's automatically converting to Title-Case? |
Yes, title-case would serialize as |
ah yes a query param would work, thx for the suggestion. |
Sorry to resurrect an old issue, but I think this behaviour might be unnecessarily opinionated in two ways:
Just some suggestions :) |
Totally agree with @johnmarkwayve. In theory, yes, all http servers should be http compliant, but in practice, it is not the case. I use reqwest in real (practical) scenarios. Besides, if http defines headers to be case-insensitive, then why not just keep the header keys exactly as the user provides them? it would do no harm and the control would be up to the user. |
I'm dealing with the exact same situation, unable to use reqwest properly due to a server that doesn't follow the HTTP spec, and the server API isn't going to change. @seanmonstar I'd love to see |
I'm also experiencing this issue with bad server implementations and this forces me to use some alternative library, when I would rather use the same one (reqwest) for everything. There are cases where you just can't fix the http server (binary firmware). |
Hi, I'm dealing with this issue as well. We are dealing with many different servers and we cannot possible force them to change to case insensitive headers. |
@benoist Did you find a workaround for this? I'm hitting the same issue. |
Is there any progress now? I have this problem too |
Having this problem too. Can we please just let the user send whatever they want? If the spec says "case insensitive" then by requiring everything to be lowercase, you yourself are violating the spec. |
Some dummy servers requires uppercased headers (e.g. CLIENT-ID), but reqwest always sends as lowercased, any solution?
The text was updated successfully, but these errors were encountered: