Kaydet (Commit) aae6a1d7 authored tarafından Jason R. Coombs's avatar Jason R. Coombs

Issue #18978: A more elegant technique for resolving the method

üst 7dc4f4bb
......@@ -321,12 +321,8 @@ class Request:
def get_method(self):
"""Return a string indicating the HTTP request method."""
if getattr(self, 'method', None) is not None:
return self.method
elif self.data is not None:
return "POST"
else:
return "GET"
default_method = "POST" if self.data is not None else "GET"
return getattr(self, 'method', default_method)
def get_full_url(self):
return self.full_url
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment