#32646: add request.json() shortcut
---------------------------------+--------------------------------------
     Reporter:  Collin Anderson  |                    Owner:  nobody
         Type:  New feature      |                   Status:  closed
    Component:  HTTP handling    |                  Version:  4.0
     Severity:  Normal           |               Resolution:  duplicate
     Keywords:                   |             Triage Stage:  Unreviewed
    Has patch:  1                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+--------------------------------------

Comment (by Collin Anderson):

 I can see the case for content negotiation.

 My two sense: In browsers, there's a standard `.json()` method for http
 responses [0], and the Python `requests` library also has `.json()`
 method, so a simple `.json()` method is becoming more of the norm for a
 lot of simple use cases.

 I don't think I'd be wrong if I said most apis only need to speak json.
 Content negotiation, while needed for some use cases, is probably overkill
 for many people's. Some people aren't going to want their endpoint to
 accept xml and yaml.

 [0] https://developer.mozilla.org/en-US/docs/Web/API/Body/json

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32646#comment:5>
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/072.69f0c8f455fbeccaab49a06387fc5054%40djangoproject.com.

Reply via email to