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
e83ff427
Kaydet (Commit)
e83ff427
authored
May 19, 2013
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed #20459 - Improved example for setting HTTP header fields.
Thanks Jérémie Blaser.
üst
6786920f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
AUTHORS
AUTHORS
+1
-0
request-response.txt
docs/ref/request-response.txt
+9
-2
No files found.
AUTHORS
Dosyayı görüntüle @
e83ff427
...
@@ -111,6 +111,7 @@ answer newbie questions, and generally made Django that much better:
...
@@ -111,6 +111,7 @@ answer newbie questions, and generally made Django that much better:
Paul Bissex <http://e-scribe.com/>
Paul Bissex <http://e-scribe.com/>
Loïc Bistuer <loic.bistuer@sixmedia.com>
Loïc Bistuer <loic.bistuer@sixmedia.com>
Simon Blanchard
Simon Blanchard
Jérémie Blaser <blaserje@gmail.com>
Craig Blaszczyk <masterjakul@gmail.com>
Craig Blaszczyk <masterjakul@gmail.com>
David Blewett <david@dawninglight.net>
David Blewett <david@dawninglight.net>
Artem Gnilov <boobsd@gmail.com>
Artem Gnilov <boobsd@gmail.com>
...
...
docs/ref/request-response.txt
Dosyayı görüntüle @
e83ff427
...
@@ -584,12 +584,19 @@ Setting header fields
...
@@ -584,12 +584,19 @@ Setting header fields
To set or remove a header field in your response, treat it like a dictionary::
To set or remove a header field in your response, treat it like a dictionary::
>>> response = HttpResponse()
>>> response = HttpResponse()
>>> response['
Cache-Control'] = 'no-cache'
>>> response['
Age'] = 120
>>> del response['
Cache-Control
']
>>> del response['
Age
']
Note that unlike a dictionary, ``del`` doesn't raise ``KeyError`` if the header
Note that unlike a dictionary, ``del`` doesn't raise ``KeyError`` if the header
field doesn't exist.
field doesn't exist.
For setting the ``Cache-Control`` and ``Vary`` header fields, it is recommended
to use the :meth:`~django.utils.cache.patch_cache_control` and
:meth:`~django.utils.cache.patch_vary_headers` methods from
:mod:`django.utils.cache`, since these fields can have multiple, comma-separated
values. The "patch" methods ensure that other values, e.g. added by a
middleware, are not removed.
HTTP header fields cannot contain newlines. An attempt to set a header field
HTTP header fields cannot contain newlines. An attempt to set a header field
containing a newline character (CR or LF) will raise ``BadHeaderError``
containing a newline character (CR or LF) will raise ``BadHeaderError``
...
...
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