1.1 --- a/WebStack/Twisted.py Thu Jan 29 23:42:47 2004 +0000
1.2 +++ b/WebStack/Twisted.py Sun Feb 01 15:28:08 2004 +0000
1.3 @@ -27,7 +27,7 @@
1.4 the transaction.
1.5 """
1.6
1.7 - return self.trans
1.8 + return self.trans.content
1.9
1.10 def get_request_method(self):
1.11
1.12 @@ -74,6 +74,16 @@
1.13
1.14 return self.parse_content_preferences(self.trans.getHeader("Accept-Charset"))
1.15
1.16 + def get_path(self):
1.17 +
1.18 + """
1.19 + A framework-specific method which gets the entire path from the request.
1.20 + """
1.21 +
1.22 + # NOTE: The path and "path info" are mostly equivalent for Twisted.
1.23 +
1.24 + return self.trans.postpath
1.25 +
1.26 def get_path_info(self):
1.27
1.28 """
1.29 @@ -82,7 +92,7 @@
1.30 request.
1.31 """
1.32
1.33 - raise NotImplementedError, "get_path_info"
1.34 + return self.trans.postpath
1.35
1.36 # Higher level request-related methods.
1.37
1.38 @@ -115,7 +125,7 @@
1.39 the transaction.
1.40 """
1.41
1.42 - return self.trans.content
1.43 + return self.trans
1.44
1.45 def set_content_type(self, content_type):
1.46
1.47 @@ -124,8 +134,6 @@
1.48 response.
1.49 """
1.50
1.51 - # Make sure that only ASCII is used in the header.
1.52 -
1.53 - self.trans.setHeader("Content-Type", content_type.encode("US-ASCII"))
1.54 + self.trans.setHeader("Content-Type", self.format_content_type(content_type))
1.55
1.56 # vim: tabstop=4 expandtab shiftwidth=4