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

 * needs_docs:  1 => 0
 * has_patch:  0 => 1
 * version:   => master
 * needs_tests:  1 => 0


Comment:

 Added pull request: https://github.com/django/django/pull/1182

 Implementation motiviations:

 1. Trying to support JSONP callbacks would require to somehow allow Cross-
 origin resource sharing. I would say it's not needed for most use cases.
 2. If extra status codes are needed they can be easily created using
 `status` parameter/`status_code` attribute. It is also not clear if
 `JsonResponse` users would want to return json responses on errors (most
 probably but I guess not always).
 3. Idea of allowing to serialize models/querysets is not bad and this
 point is actually I am most interested to get feedback on.
 4. I would leave XML for now. Especially as this ticket is specifically
 about JSON.

 Please let me know your thoughts.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17942#comment:6>
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