etwist/request.py
changeset 2485 ae74b46ea96c
parent 2476 1294a6bdf3bf
child 4212 ab6573088b4a
equal deleted inserted replaced
2484:7e9283731db8 2485:ae74b46ea96c
    36         # prepare output headers
    36         # prepare output headers
    37         self.headers_out = http_headers.Headers()
    37         self.headers_out = http_headers.Headers()
    38         self._headers = req.headers
    38         self._headers = req.headers
    39 
    39 
    40     def base_url(self):
    40     def base_url(self):
    41         """return the root url of the application"""
    41         """return the root url of the instance"""
    42         return self._base_url
    42         return self._base_url
    43 
    43 
    44     def http_method(self):
    44     def http_method(self):
    45         """returns 'POST', 'GET', 'HEAD', etc."""
    45         """returns 'POST', 'GET', 'HEAD', etc."""
    46         return self._twreq.method
    46         return self._twreq.method
    47 
    47 
    48     def relative_path(self, includeparams=True):
    48     def relative_path(self, includeparams=True):
    49         """return the normalized path of the request (ie at least relative
    49         """return the normalized path of the request (ie at least relative
    50         to the application's root, but some other normalization may be needed
    50         to the instance's root, but some other normalization may be needed
    51         so that the returned path may be used to compare to generated urls
    51         so that the returned path may be used to compare to generated urls
    52 
    52 
    53         :param includeparams:
    53         :param includeparams:
    54            boolean indicating if GET form parameters should be kept in the path
    54            boolean indicating if GET form parameters should be kept in the path
    55         """
    55         """