-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
HTTPRequest
: Expose and add methods to make working with headers easier
#63713
HTTPRequest
: Expose and add methods to make working with headers easier
#63713
Conversation
Since the headers are returned as a dictionary, I think it'll be easier to work with if the keys are always lower-cased. Users can then use lower-cased names to get the header value. Otherwise, they have to iterate through the keys and make case-insensitive compares. |
I have done it this way in order to keep consistency with HTTPClient. |
Should be all good now |
The commits need to be squashed into 1 commit :) |
…sier Exposes `has_header()` and `get_header_value()` methods and adds `get_dictionary_from_headers` method. Add documentation Update doc/classes/HTTPRequest.xml Make HTTPClient.get_response_headers_as_dictionary() and HTTPRequest.get_dictionary_from_headers() use lower-case keys Fix typo Co-Authored-By: Max Hilbrunner <[email protected]>
6ba8c17
to
2c1c706
Compare
@Kubulambula if it's OK with you, I can create a new PR with this changes and add you as co-author. |
No problem at all. I would be happy if this functionality makes it in! |
Superseded by #97174. Thanks for the contribution! |
Closes 4734
Exposes
has_header()
andget_header_value()
methods and addsget_dictionary_from_headers
method.Also converts headers to lower-case in
HTTPClient::_get_response_headers_as_dictionary()
as well as inHTTPRequest::get_dictionary_from_headers()
to keep consistensy.This should be a done right version of 62962