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
290145e6
Kaydet (Commit)
290145e6
authored
Agu 12, 2015
tarafından
Tim Graham
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Corrected indentation of JsonResponse docs.
üst
b7508896
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
request-response.txt
docs/ref/request-response.txt
+8
-10
No files found.
docs/ref/request-response.txt
Dosyayı görüntüle @
290145e6
...
@@ -912,9 +912,7 @@ types of HTTP responses. Like ``HttpResponse``, these subclasses live in
...
@@ -912,9 +912,7 @@ types of HTTP responses. Like ``HttpResponse``, these subclasses live in
JsonResponse objects
JsonResponse objects
====================
====================
.. class:: JsonResponse
.. class:: JsonResponse(data, encoder=DjangoJSONEncoder, safe=True, **kwargs)
.. method:: JsonResponse.__init__(data, encoder=DjangoJSONEncoder, safe=True, **kwargs)
An :class:`HttpResponse` subclass that helps to create a JSON-encoded
An :class:`HttpResponse` subclass that helps to create a JSON-encoded
response. It inherits most behavior from its superclass with a couple
response. It inherits most behavior from its superclass with a couple
...
@@ -922,19 +920,19 @@ JsonResponse objects
...
@@ -922,19 +920,19 @@ JsonResponse objects
Its default ``Content-Type`` header is set to ``application/json``.
Its default ``Content-Type`` header is set to ``application/json``.
The first parameter, ``data``, should be a ``dict`` instance. If the ``safe``
The first parameter, ``data``, should be a ``dict`` instance. If the
parameter is set to ``False`` (see below) it can be any JSON-serializable
``safe`` parameter is set to ``False`` (see below) it can be any
object.
JSON-serializable
object.
The ``encoder``, which defaults to
The ``encoder``, which defaults to
``django.core.serializers.json.DjangoJSONEncoder``, will be used to
``django.core.serializers.json.DjangoJSONEncoder``, will be used to
serialize the data. See :ref:`JSON serialization
serialize the data. See :ref:`JSON serialization
<serialization-formats-json>` for more details about this serializer.
<serialization-formats-json>` for more details about this serializer.
The ``safe`` boolean parameter defaults to ``True``. If it's set to ``False``,
The ``safe`` boolean parameter defaults to ``True``. If it's set to
any object can be passed for serialization (otherwise only ``dict`` instances
``False``, any object can be passed for serialization (otherwise only
are allowed). If ``safe`` is ``True`` and a non-``dict`` object is passed as
``dict`` instances are allowed). If ``safe`` is ``True`` and a non-``dict``
the first argument, a :exc:`TypeError` will be raised.
object is passed as
the first argument, a :exc:`TypeError` will be raised.
Usage
Usage
-----
-----
...
...
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