Allow any method, if so inclined
authorKenneth Reitz <me@kennethreitz.com>
Thu, 18 Aug 2011 00:13:44 +0000 (20:13 -0400)
committerKenneth Reitz <me@kennethreitz.com>
Thu, 18 Aug 2011 00:15:28 +0000 (20:15 -0400)
#124

AUTHORS
requests/models.py

diff --git a/AUTHORS b/AUTHORS
index dd1b310..5bd399a 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -35,4 +35,5 @@ Patches and Suggestions
 - Jens Diemer
 - Alex <@alopatin>
 - Tom Hogans <tomhsx@gmail.com>
-- Armin Ronacher
\ No newline at end of file
+- Armin Ronacher
+- Shrikant Sharat Kandula
\ No newline at end of file
index d6b058f..0b22f71 100644 (file)
@@ -32,8 +32,6 @@ class Request(object):
     Requests. Recommended interface is with the Requests functions.
     """
 
-    _METHODS = ('GET', 'HEAD', 'PUT', 'POST', 'DELETE', 'PATCH')
-
     def __init__(self,
         url=None, headers=dict(), files=None, method=None, data=dict(),
         params=dict(), auth=None, cookiejar=None, timeout=None, redirect=False,
@@ -116,14 +114,6 @@ class Request(object):
         return '<Request [%s]>' % (self.method)
 
 
-    def __setattr__(self, name, value):
-        if (name == 'method') and (value):
-            if not value in self._METHODS:
-                raise InvalidMethod()
-
-        object.__setattr__(self, name, value)
-
-
     def _checks(self):
         """Deterministic checks for consistency."""