#17942: JSONResponse class for API responses
-------------------------------+-------------------------------------------
     Reporter:  leahculver     |                    Owner:  LukaszBalcerzak
         Type:  New feature    |                   Status:  assigned
    Component:  HTTP handling  |                  Version:  master
     Severity:  Normal         |               Resolution:
     Keywords:  dceu13         |             Triage Stage:  Accepted
    Has patch:  1              |      Needs documentation:  0
  Needs tests:  1              |  Patch needs improvement:  1
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+-------------------------------------------
Changes (by charettes):

 * needs_tests:  0 => 1


Comment:

 As discussed on the PR thread.

 - The class should be named `JSONResponse`.
 - The `_default_content_type` attribute should be replaced by
 `kwargs.setdefault('content_type', 'application/json')`.
 - The `JSON_RESPONSE_DEFAULT_ENCODER` and `JSON_RESPONSE_ALLOW_DICTS_ONLY`
 settings should not be introduced and kwargs should be used instead.
 - The `encoder` should just default to `None`, it should be really easy to
 specify an encoder class without subclassing.
 - Why are you setting `ensure_ascii` to `False`? I've never had any issues
 dealing with non-ascii escaped data?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17942#comment:9>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/068.e3459d5ea206f4bf3e0eb65014ff0010%40djangoproject.com?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to