From ddc0ee35b2bf954c8d4b0a69cea3cf0f4f477e10 Mon Sep 17 00:00:00 2001 From: Mark Jones Date: Wed, 17 Aug 2016 11:58:12 -0500 Subject: Clarify that headers are ADDED to the response Make it clear that headers are added to the response instead of overwriting existing headers. Explain how to set the content_type instead of just assuming they will know. --- pyramid/httpexceptions.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pyramid/httpexceptions.py b/pyramid/httpexceptions.py index e76f43c8a..b44227fc5 100644 --- a/pyramid/httpexceptions.py +++ b/pyramid/httpexceptions.py @@ -98,7 +98,9 @@ be forwarded to its :class:`~pyramid.response.Response` superclass: a plain-text override of the default ``detail`` ``headers`` - a list of (k,v) header pairs + a list of (k,v) header pairs or a dict to be added to the + response, use content_type='application/json' kwarg to change + the content type of the response. ``comment`` a plain-text additional information which is -- cgit v1.2.3 From 24e1b3b0bd5e15ab13d7c89ef9a291f1b464724c Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Mon, 19 Sep 2016 21:01:07 -0500 Subject: clarify #2750 a bit further --- pyramid/httpexceptions.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pyramid/httpexceptions.py b/pyramid/httpexceptions.py index b44227fc5..054917dfa 100644 --- a/pyramid/httpexceptions.py +++ b/pyramid/httpexceptions.py @@ -98,9 +98,10 @@ be forwarded to its :class:`~pyramid.response.Response` superclass: a plain-text override of the default ``detail`` ``headers`` - a list of (k,v) header pairs or a dict to be added to the - response, use content_type='application/json' kwarg to change - the content type of the response. + a list of (k,v) header pairs, or a dict, to be added to the + response; use the content_type='application/json' kwarg and other + similar kwargs to to change properties of the response supported by the + :class:`pyramid.response.Response` superclass ``comment`` a plain-text additional information which is -- cgit v1.2.3