Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
74151765
Kaydet (Commit)
74151765
authored
Haz 29, 2013
tarafından
Aymeric Augustin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplified description of HttpResponse(<iterator>)
Related to
8b9b8d3b
.
üst
acd7b34a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
21 deletions
+5
-21
request-response.txt
docs/ref/request-response.txt
+5
-21
No files found.
docs/ref/request-response.txt
Dosyayı görüntüle @
74151765
...
...
@@ -555,28 +555,12 @@ file-like object::
Passing iterators
~~~~~~~~~~~~~~~~~
Finally, you can pass ``HttpResponse`` an iterator rather than strings. If you
use this technique, the iterator should return strings.
Finally, you can pass ``HttpResponse`` an iterator rather than strings.
``HttpResponse`` will consume the iterator immediately, store its content as a
string, and discard it.
Passing an iterator as content to :class:`HttpResponse` creates a
streaming response if (and only if) no middleware accesses the
:attr:`HttpResponse.content` attribute before the response is returned.
.. versionchanged:: 1.5
This technique is fragile and was deprecated in Django 1.5. If you need the
response to be streamed from the iterator to the client, you should use the
:class:`StreamingHttpResponse` class instead.
As of Django 1.7, when :class:`HttpResponse` is instantiated with an
iterator, it will consume it immediately, store the response content as a
string, and discard the iterator.
.. versionchanged:: 1.5
You can now use :class:`HttpResponse` as a file-like object even if it was
instantiated with an iterator. Django will consume and save the content of
the iterator on first access.
If you need the response to be streamed from the iterator to the client, you
must use the :class:`StreamingHttpResponse` class instead.
Setting header fields
~~~~~~~~~~~~~~~~~~~~~
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment