Skip to content
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

Remove HttpRequestMessage.GetHeaderValue and HttpResponseMessage.GetHeaderValue #553

Closed
tmenier opened this issue Sep 25, 2020 · 3 comments

Comments

@tmenier
Copy link
Owner

tmenier commented Sep 25, 2020

These extension methods are no longer needed internally, and although they're public, I suspect they're not very useful, mainly because FlurlRequest and FlurlResponse contain the Headers abstractions that should generally be used.

If there are major objections, I might consider bringing these back, although 3.0 handles the case of multiple headers of the same name (mostly for Set-Header) with the exception these methods, so keeping them as-is isn't a very appealing option.

The SetHeader extension method is still used internally and has a lot of smarts to it, mainly deciding whether to add a given header the message object itself or its Content property, so I'm leaving that one alone.

@tranb3r
Copy link
Contributor

tranb3r commented Oct 1, 2020

Question:
HttpResponseMessage.Headers.GetValues(headerName) is case-insensitive on headerName.
The equivalent using Flurl would be FlurlResponse.Headers.FirstOfDefault(headerName), but I believe it's case-sensitive on headerName, isn't it ?

@tmenier
Copy link
Owner Author

tmenier commented Oct 1, 2020

@tranb3r Good catch. You are correct that they're case-sensitive currently but according to the spec should not be. I'll get that fixed.

@tmenier
Copy link
Owner Author

tmenier commented Oct 24, 2020

@tranb3r Header names are now case-insensitive in prerelease 6. Thanks again for reporting that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants