#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
-------------------------------+-------------------------------------------

Comment (by LukaszBalcerzak):

 * Well, name of the class should correspond to the nearest classes in my
 view. As already noticed at https://github.com/django/django/pull/1182
 those Xml/Html/Http names are used inconsistently however it would look
 odd seeing `JSONResponse` near to `HttpResponse`
 * I can move content type default value to the class implementation (as
 opposed to `HttpResponseBase` attribute) but then we have 2 places where
 we need to compute full header's value (including `charset`)
 * Ok, seeing settings generate a lot of comments I'm going to remove them
 entirely in favor of `encoder` and `safe` parameters
 * Still, `encoder`'s default value should be `DjangoJSONEncoder`
 * `ensure_ascii=False` is there to allow non ascii chars to be pushed into
 response's content. On second thought, though, I actually believe it
 wasn't good idea. Am going to remove that.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17942#comment:10>
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].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to