Skip to content

Commit efc7c1d

Browse files
Update accepted_media_type argument in Renderer docs (#8364)
1 parent 5bea22f commit efc7c1d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/api-guide/renderers.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ This renderer is used for rendering HTML multipart form data. **It is not suita
257257

258258
# Custom renderers
259259

260-
To implement a custom renderer, you should override `BaseRenderer`, set the `.media_type` and `.format` properties, and implement the `.render(self, data, media_type=None, renderer_context=None)` method.
260+
To implement a custom renderer, you should override `BaseRenderer`, set the `.media_type` and `.format` properties, and implement the `.render(self, data, accepted_media_type=None, renderer_context=None)` method.
261261

262262
The method should return a bytestring, which will be used as the body of the HTTP response.
263263

@@ -267,7 +267,7 @@ The arguments passed to the `.render()` method are:
267267

268268
The request data, as set by the `Response()` instantiation.
269269

270-
### `media_type=None`
270+
### `accepted_media_type=None`
271271

272272
Optional. If provided, this is the accepted media type, as determined by the content negotiation stage.
273273

@@ -291,7 +291,7 @@ The following is an example plaintext renderer that will return a response with
291291
media_type = 'text/plain'
292292
format = 'txt'
293293

294-
def render(self, data, media_type=None, renderer_context=None):
294+
def render(self, data, accepted_media_type=None, renderer_context=None):
295295
return smart_text(data, encoding=self.charset)
296296

297297
## Setting the character set
@@ -303,7 +303,7 @@ By default renderer classes are assumed to be using the `UTF-8` encoding. To us
303303
format = 'txt'
304304
charset = 'iso-8859-1'
305305

306-
def render(self, data, media_type=None, renderer_context=None):
306+
def render(self, data, accepted_media_type=None, renderer_context=None):
307307
return data.encode(self.charset)
308308

309309
Note that if a renderer class returns a unicode string, then the response content will be coerced into a bytestring by the `Response` class, with the `charset` attribute set on the renderer used to determine the encoding.
@@ -318,7 +318,7 @@ In some cases you may also want to set the `render_style` attribute to `'binary'
318318
charset = None
319319
render_style = 'binary'
320320

321-
def render(self, data, media_type=None, renderer_context=None):
321+
def render(self, data, accepted_media_type=None, renderer_context=None):
322322
return data
323323

324324
---

0 commit comments

Comments
 (0)