2
>>> from django.http import HttpRequest
3
>>> print repr(HttpRequest())
10
>>> from django.core.handlers.wsgi import WSGIRequest
11
>>> print repr(WSGIRequest({'PATH_INFO': 'bogus', 'REQUEST_METHOD': 'bogus'}))
18
>>> from django.core.handlers.modpython import ModPythonRequest
19
>>> class FakeModPythonRequest(ModPythonRequest):
20
... def __init__(self, *args, **kwargs):
21
... super(FakeModPythonRequest, self).__init__(*args, **kwargs)
22
... self._get = self._post = self._meta = self._cookies = {}
24
... def get_options(self):
28
>>> print repr(FakeModPythonRequest(req))
36
>>> from django.http import parse_cookie
37
>>> parse_cookie('invalid:key=true')
40
>>> request = HttpRequest()
41
>>> print request.build_absolute_uri(location="https://www.example.com/asdf")
42
https://www.example.com/asdf
43
>>> request.get_host = lambda: 'www.example.com'
45
>>> print request.build_absolute_uri(location="/path/with:colons")
46
http://www.example.com/path/with:colons