MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / getheader

Method getheader

tools/python-3.11.9-amd64/Lib/http/client.py:726–744  ·  view source on GitHub ↗

Returns the value of the header matching *name*. If there are multiple matching headers, the values are combined into a single string separated by commas and spaces. If no matching header is found, returns *default* or None if the *default* is not specified.

(self, name, default=None)

Source from the content-addressed store, hash-verified

724 return self.fp.fileno()
725
726 def getheader(self, name, default=None):
727 '''Returns the value of the header matching *name*.
728
729 If there are multiple matching headers, the values are
730 combined into a single string separated by commas and spaces.
731
732 If no matching header is found, returns *default* or None if
733 the *default* is not specified.
734
735 If the headers are unknown, raises http.client.ResponseNotReady.
736
737 '''
738 if self.headers is None:
739 raise ResponseNotReady()
740 headers = self.headers.get_all(name) or default
741 if isinstance(headers, str) or not hasattr(headers, '__iter__'):
742 return headers
743 else:
744 return ', '.join(headers)
745
746 def getheaders(self):
747 """Return list of (header, value) tuples."""

Callers 2

single_requestMethod · 0.45
parse_responseMethod · 0.45

Calls 3

ResponseNotReadyClass · 0.85
get_allMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected