mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Fixed #31789 -- Added a new headers interface to HttpResponse.
This commit is contained in:
committed by
Mariusz Felisiak
parent
71ae1ab012
commit
bcc2befd0e
@@ -551,9 +551,9 @@ Specifically, a ``Response`` object has the following attributes:
|
||||
If the given URL is not found, accessing this attribute will raise a
|
||||
:exc:`~django.urls.Resolver404` exception.
|
||||
|
||||
You can also use dictionary syntax on the response object to query the value
|
||||
of any settings in the HTTP headers. For example, you could determine the
|
||||
content type of a response using ``response['Content-Type']``.
|
||||
As with a normal response, you can also access the headers through
|
||||
:attr:`.HttpResponse.headers`. For example, you could determine the content
|
||||
type of a response using ``response.headers['Content-Type']``.
|
||||
|
||||
Exceptions
|
||||
----------
|
||||
|
||||
Reference in New Issue
Block a user