Commit deacce2c authored by Martin v. Löwis's avatar Martin v. Löwis

Patch #800236: add HTTPResponse.getheaders().

parent c473c99d
......@@ -211,6 +211,10 @@ Get the contents of the header \var{name}, or \var{default} if there is no
matching header.
\end{methoddesc}
\begin{methoddesc}{getheaders}{}
Return a list of (header, value) tuples. \versionadded{2.4}
\end{methoddesc}
\begin{datadesc}{msg}
A \class{mimetools.Message} instance containing the response headers.
\end{datadesc}
......
......@@ -493,6 +493,12 @@ class HTTPResponse:
raise ResponseNotReady()
return self.msg.getheader(name, default)
def getheaders(self):
"""Return list of (header, value) tuples."""
if self.msg is None:
raise ResponseNotReady()
return self.msg.items()
class HTTPConnection:
......
......@@ -44,6 +44,8 @@ Extension modules
Library
-------
- HTTPResponse has now a getheaders method.
- Patch #1006219: let inspect.getsource handle '@' decorators. Thanks Simon
Percivall.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment