diff options
Diffstat (limited to 'docs/api-guide/requests.md')
| -rw-r--r-- | docs/api-guide/requests.md | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/docs/api-guide/requests.md b/docs/api-guide/requests.md index 9711d989..439c97bc 100644 --- a/docs/api-guide/requests.md +++ b/docs/api-guide/requests.md @@ -45,6 +45,8 @@ You won't typically need to access this property. **Note:** If a client sends malformed content, then accessing `request.DATA` or `request.FILES` may raise a `ParseError`. By default REST framework's `APIView` class or `@api_view` decorator will catch the error and return a `400 Bad Request` response. +If a client sends a request with a content-type that cannot be parsed then a `UnsupportedMediaType` exception will be raised, which by default will be caught and return a `415 Unsupported Media Type` response. + --- # Authentication @@ -111,6 +113,15 @@ If you do need to access the raw content directly, you should use the `.stream` For more information see the [browser enhancements documentation]. +--- + +# Standard HttpRequest attributes + +As REST framework's `Request` extends Django's `HttpRequest`, all the other standard attributes and methods are also available. For example the `request.META` dictionary is available as normal. + +Note that due to implementation reasons the `Request` class does not inherit from `HttpRequest` class, but instead extends the class using composition. + + [cite]: https://groups.google.com/d/topic/django-developers/dxI4qVzrBY4/discussion [parsers documentation]: parsers.md [authentication documentation]: authentication.md |
