From bfe28ae7077b08da53bfbd863a3eae558848da68 Mon Sep 17 00:00:00 2001 From: Bo Pace Date: Mon, 17 Oct 2016 14:10:05 -0600 Subject: [PATCH 1/2] Added documentation about accessing header values --- docs/topics/request-response.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/topics/request-response.rst b/docs/topics/request-response.rst index 75b98d3b36b..5d9ac79f638 100644 --- a/docs/topics/request-response.rst +++ b/docs/topics/request-response.rst @@ -507,7 +507,13 @@ Response objects .. attribute:: Response.headers - A dictionary-like object which contains the response headers. + A dictionary-like object which contains the response headers. Values can + be accessed from the :class:`headers` object by using :meth:`get` to + return the first header value with the specified name or :meth:`getlist` + to return all header values with the specified name. For example, this + call will give you all cookies in the headers:: + + response.headers.getlist('Set-Cookie') .. attribute:: Response.body From fd016ee71b4d85f6b4e02a0da4a7ebd11f787e0b Mon Sep 17 00:00:00 2001 From: bopace Date: Tue, 18 Oct 2016 09:37:45 -0600 Subject: [PATCH 2/2] Fixed wording of documentation --- docs/topics/request-response.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/topics/request-response.rst b/docs/topics/request-response.rst index 5d9ac79f638..a45ea69394c 100644 --- a/docs/topics/request-response.rst +++ b/docs/topics/request-response.rst @@ -508,10 +508,10 @@ Response objects .. attribute:: Response.headers A dictionary-like object which contains the response headers. Values can - be accessed from the :class:`headers` object by using :meth:`get` to - return the first header value with the specified name or :meth:`getlist` - to return all header values with the specified name. For example, this - call will give you all cookies in the headers:: + be accessed using :meth:`get` to return the first header value with the + specified name or :meth:`getlist` to return all header values with the + specified name. For example, this call will give you all cookies in the + headers:: response.headers.getlist('Set-Cookie')