diff options
| author | Sébastien Piquemal | 2012-02-07 13:15:30 +0200 |
|---|---|---|
| committer | Sébastien Piquemal | 2012-02-07 13:15:30 +0200 |
| commit | ca96b4523b4c09489e4bfe726a894a5c6ada78aa (patch) | |
| tree | 7f9613e56b6ceb7f1c2760e2def3ec9114983430 /djangorestframework/request.py | |
| parent | a0dc0b10e53cd565b8264407769b6fd468a46230 (diff) | |
| download | django-rest-framework-ca96b4523b4c09489e4bfe726a894a5c6ada78aa.tar.bz2 | |
cleaned a bit Response/ResponseMixin code, added some documentation + renamed ErrorResponse to ImmediateResponse
Diffstat (limited to 'djangorestframework/request.py')
| -rw-r--r-- | djangorestframework/request.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/djangorestframework/request.py b/djangorestframework/request.py index ee43857e..21538aec 100644 --- a/djangorestframework/request.py +++ b/djangorestframework/request.py @@ -11,7 +11,7 @@ This enhanced request object offers the following : from django.http import HttpRequest -from djangorestframework.response import ErrorResponse +from djangorestframework.response import ImmediateResponse from djangorestframework import status from djangorestframework.utils.mediatypes import is_form_media_type, order_by_precedence from djangorestframework.utils import as_tuple @@ -194,7 +194,7 @@ class Request(object): """ Parse the request content. - May raise a 415 ErrorResponse (Unsupported Media Type), or a 400 ErrorResponse (Bad Request). + May raise a 415 ImmediateResponse (Unsupported Media Type), or a 400 ImmediateResponse (Bad Request). """ if stream is None or content_type is None: return (None, None) @@ -206,7 +206,7 @@ class Request(object): if parser.can_handle_request(content_type): return parser.parse(stream) - raise ErrorResponse(content={'error': + raise ImmediateResponse(content={'error': 'Unsupported media type in request \'%s\'.' % content_type}, status=status.HTTP_415_UNSUPPORTED_MEDIA_TYPE) |
