add content_type property in request

This commit is contained in:
Yun Xu 2017-06-07 20:46:48 -07:00
parent 4fdf340d04
commit aac99c45c0

View File

@ -174,6 +174,10 @@ class Request(dict):
# so pull it from the headers # so pull it from the headers
return self.headers.get('Host', '') return self.headers.get('Host', '')
@property
def content_type(self):
return self.headers.get('Content-Type', DEFAULT_HTTP_CONTENT_TYPE)
@property @property
def path(self): def path(self):
return self._parsed_url.path.decode('utf-8') return self._parsed_url.path.decode('utf-8')