response

The response module provides Response classes you can use in your views to return a certain HTTP response. Typically a response is rendered into a HTTP response depending on what renderers are set on your view and als depending on the accept header of the request.

class response.Response(status=200, content=None, headers=None)[source]

An HttpResponse that may include content that hasn’t yet been serialized.

status_text[source]

Return reason text corresponding to our HTTP response status code. Provided for convenience.

exception response.ErrorResponse(status, content=None, headers={})[source]

An exception representing an Response that should be returned immediately. Any content should be serialized as-is, without being filtered.

Project Versions

Previous topic

resource

Next topic

serializer

This Page