def render(self, request=None, context=None, template_name=None):
request, context, template_name = self.get_render_params(request, context, template_name)<EOL>self.set_renderers()<EOL>status_code = context.pop('<STR_LIT>', http_client.OK)<EOL>additional_headers = context.pop('<STR_LIT>', {})<EOL>for renderer in request.renderers:<EOL><INDENT>response = renderer(request, context, template_name)<EOL>if response is NotImplemented:<EOL><INDENT>continue<EOL><DEDENT>response.status_code = status_code<EOL>response.renderer = renderer<EOL>break<EOL><DEDENT>else:<EOL><INDENT>tried_mimetypes = list(itertools.chain(*[r.mimetypes for r in request.renderers]))<EOL>response = self.http_not_acceptable(request, tried_mimetypes)<EOL>response.renderer = None<EOL><DEDENT>for key, value in additional_headers.items():<EOL><INDENT>response[key] = value<EOL><DEDENT>patch_vary_headers(response, ('<STR_LIT>',))<EOL>return response<EOL>
Returns a HttpResponse of the right media type as specified by the
request.

context can contain status_code and additional_headers members, to set
the HTTP status code and headers of the request, respectively.
template_name should lack a file-type suffix (e.g. '.html', as
renderers will append this as necessary.