mirror of
https://github.com/django/django.git
synced 2025-10-23 21:59:11 +00:00
Added 'method' attribute to HttpRequest objects
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3164 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -98,6 +98,9 @@ class ModPythonRequest(http.HttpRequest):
|
||||
self._raw_post_data = self._req.read()
|
||||
return self._raw_post_data
|
||||
|
||||
def _get_method(self):
|
||||
return self.META['REQUEST_METHOD'].upper()
|
||||
|
||||
GET = property(_get_get, _set_get)
|
||||
POST = property(_get_post, _set_post)
|
||||
COOKIES = property(_get_cookies, _set_cookies)
|
||||
@@ -105,6 +108,7 @@ class ModPythonRequest(http.HttpRequest):
|
||||
META = property(_get_meta)
|
||||
REQUEST = property(_get_request)
|
||||
raw_post_data = property(_get_raw_post_data)
|
||||
method = property(_get_method)
|
||||
|
||||
class ModPythonHandler(BaseHandler):
|
||||
def __call__(self, req):
|
||||
|
||||
@@ -55,6 +55,7 @@ class WSGIRequest(http.HttpRequest):
|
||||
self.environ = environ
|
||||
self.path = environ['PATH_INFO']
|
||||
self.META = environ
|
||||
self.method = environ['REQUEST_METHOD'].upper()
|
||||
|
||||
def __repr__(self):
|
||||
from pprint import pformat
|
||||
|
||||
Reference in New Issue
Block a user