Code

Opened 5 years ago

Closed 5 years ago

#9943 closed (wontfix)

Implement the rest of the HTTP require_* decorators and HttpResponse* classes

Reported by: zhirsch Owned by: nobody
Component: HTTP handling Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

Hi,

I've been using Django to implement a few JSON web services, and I've found myself writing the (trivial) require_PUT, require_DELETE, etc. decorators to parallel those already defined in django/views/decorators/http.py. I've also found myself writing the (again, trivial) HttpResponseCreated, HttpResponseNoContent, etc. classes to parallel those in django/http/__init__.py.

I think it would be nice if these were built-in to Django, since they're easy to write, don't cause much overhead, and are pretty useful to have. Rather than cherry-pick the ones that I've used, or the ones that I think would be most useful, I've just done through the HTTP RFC and added them all. A patch is attached.

Thanks,
-Zach

Attachments (1)

http-methods-and-statuses.diff (5.7 KB) - added by zhirsch 5 years ago.

Download all attachments as: .zip

Change History (2)

Changed 5 years ago by zhirsch

comment:1 Changed 5 years ago by Alex

  • Resolution set to wontfix
  • Status changed from new to closed

I'm won't fixing this since:

a) It's dealing with 2 issues, please open 1 ticket per issue.
b) Django doens't need to contain a class for every possible http status code, you are more than welcome to use whatever you like within your own code.

If you'd like feel free to open a seperate ticket for the decorators, although it is my inclination that that will, and should be, won't fixed as well.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.