mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-11 14:31:56 +08:00
While the documentation for `HttpResponse` and `StreamingHttpResponse` *says* `content` and `streaming_content` should be bytestrings [1] or an iterable of bytestrings respectively [2], this is not what the API supports [3] [4] and there are tests which make sure the API supports more than bytestrings [5] [6] [etc]. Before assigning `content` or `streaming_content` the code paths will call `self.make_bytes` to coerce the value to bytes. [1]:ecf87ad513/django/http/response.py (L324-L327)[2]:0a28b42b15/django/http/response.py (L395-L399)[3]:ecf87ad513/django/http/response.py (L342-L362)[4]:0a28b42b15/django/http/response.py (L415-L427)[5]:0a28b42b15/tests/cache/tests.py (L2250)[6]:0a28b42b15/tests/i18n/urls.py (L8)