Opened 5 years ago
Last modified 4 years ago
#31789 closed Cleanup/optimization
Add a cleaner interface for response headers — at Initial Version
Description ¶
This proposal is to replace HttpResponse._headers
with HttpResponse.headers
as a public interface using a variation of django.utils.datasctructures.CaseInsensitiveMapping
.
It also includes updating tests and documentation to use this, rather than the old dict-like interface, i.e. response.headers['Content-Type'] = 'application/json'
response['Content-Type'] = 'application/json'
.
The dict-like interface won't be deprecated, but will become undocumented, and tests added purely for backwards-compatibility.