rest_framework.response

The Response class in REST framework is similar to HTTPResponse, except that it is initialized with unrendered data, instead of a pre-rendered string.

The appropriate renderer is called during Django’s template response rendering.

Module Contents

class Response(data=None, status=None, template_name=None, headers=None, exception=False, content_type=None)

Bases:django.template.response.SimpleTemplateResponse

An HttpResponse that allows its data to be rendered into arbitrary media types.

rendered_content
status_text

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

__getstate__(self)

Remove attributes from the response that shouldn’t be cached.