-
HttpRequest
-
Attributes
-
path
- string
- /usr/1?name=tom
-
method
- string
- 'GET' or 'POST'
- GET
- POST
-
REQUEST
- dict
- POST have priority over GET
-
COOKIES
- dict
-
FILES
- dict
- filename| content-type | content
- just method is 'POST' and form contains 'enctype="multipart/form-data"'
-
META
- dict
- all about Http Headers
-
user
- django.contrib.auth.models.User
- django.contrib.auth.models.AnonymousUser
- session
- raw_post_data
-
Methods
-
__getitem__(key)
- return value with the given-key in POST and GET ,POST is first
-
has_key()
- check the given-key if it's in the POST or GET
- get_full_path()
-
is_secure()
- if https , return true
-
HttpResponse
-
Instance
- simplely pass string-style page content
- also,use as a FILE Object such as write...
- pass iterator with string returned
-
Subclass
-
HttpResponseRedirect
- constant by URL
- HttpResponsePermanentRedirect
- HttpResponseNotModified
- HttpResponseBadRequest
- HttpResponseNotFound
- HttpResponseForbidden
- HttpResponseNotAllowed
- HttpResponseGone
- HttpResponseServerError