`HTTPRequest`: Expose and add methods to make working with headers easier
Closes 4734
Exposes has_header() and get_header_value() methods and adds get_dictionary_from_headers method.
Also converts headers to lower-case in HTTPClient::_get_response_headers_as_dictionary() as well as in HTTPRequest::get_dictionary_from_headers() to keep consistensy.
This should be a done right version of 62962
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.
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. It would make sense to make the keys case-insensitive in my opinion, but do it the same way in both cases
Should be all good now
The commits need to be squashed into 1 commit :)