http.HttpRequest

class HttpRequest [source]

http.HttpRequest.body

HttpRequest.body The raw HTTP request body as a byte string. This is useful for processing data in different ways than conventional HTML forms: binary images, XML payload etc. For processing conventional form data, use HttpRequest.POST. You can also read from an HttpRequest using a file-like interface. See HttpRequest.read().

http.HttpRequest.build_absolute_uri()

HttpRequest.build_absolute_uri(location) [source] Returns the absolute URI form of location. If no location is provided, the location will be set to request.get_full_path(). If the location is already an absolute URI, it will not be altered. Otherwise the absolute URI is built using the server variables available in this request. Example: "https://example.com/music/bands/the_beatles/?print=true" Note Mixing HTTP and HTTPS on the same site is discouraged, therefore build_absolute_uri() will

http.HttpRequest.content_params

HttpRequest.content_params New in Django 1.10. A dictionary of key/value parameters included in the CONTENT_TYPE header.

http.HttpRequest.content_type

HttpRequest.content_type New in Django 1.10. A string representing the MIME type of the request, parsed from the CONTENT_TYPE header.

http.HttpRequest.COOKIES

HttpRequest.COOKIES A standard Python dictionary containing all cookies. Keys and values are strings.

http.HttpRequest.current_app

HttpRequest.current_app The url template tag will use its value as the current_app argument to reverse().

http.HttpRequest.encoding

HttpRequest.encoding A string representing the current encoding used to decode form submission data (or None, which means the DEFAULT_CHARSET setting is used). You can write to this attribute to change the encoding used when accessing the form data. Any subsequent attribute accesses (such as reading from GET or POST) will use the new encoding value. Useful if you know the form data is not in the DEFAULT_CHARSET encoding.

http.HttpRequest.FILES

HttpRequest.FILES A dictionary-like object containing all uploaded files. Each key in FILES is the name from the <input type="file" name="" />. Each value in FILES is an UploadedFile. See Managing files for more information. Note that FILES will only contain data if the request method was POST and the <form> that posted to the request had enctype="multipart/form-data". Otherwise, FILES will be a blank dictionary-like object.

http.HttpRequest.GET

HttpRequest.GET A dictionary-like object containing all given HTTP GET parameters. See the QueryDict documentation below.