#36209: Add HttpResponse subclasses for No Content and Created
-------------------------------------+-------------------------------------
     Reporter:  Michiel Beijen       |                    Owner:  (none)
         Type:  New feature          |                   Status:  closed
    Component:  HTTP handling        |                  Version:  dev
     Severity:  Normal               |               Resolution:  duplicate
     Keywords:  HttpResponse REST    |             Triage Stage:
  201 204                            |  Unreviewed
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Jacob Walls):

 * keywords:  HttpResponse REST => HttpResponse REST 201 204
 * resolution:   => duplicate
 * status:  new => closed

Comment:

 Thanks for the ticket.

 > it's more clear to write HttpResponseRedirect() or
 HttpResponsePermanentRedirect() than to use HttpResponse with a 301 or 302
 status code, because that requires you to 'know' which status code is
 which.

 For self-documenting/readable status codes, the advice is to use the
 `HTTPStatus` [https://docs.python.org/3/library/http.html#http.HTTPStatus
 enum] from python.

 Duplicate of #3362

 Also [https://forum.djangoproject.com/t/proposal-custom-jsonresponse-
 status-classes/36426/7 discussed] recently on forum for JSONResponse.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36209#comment:1>
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 visit 
https://groups.google.com/d/msgid/django-updates/010701952d521f00-fb2fd389-39f3-4c81-ae7f-ff76d37e7657-000000%40eu-central-1.amazonses.com.

Reply via email to