Skip to content

Commit f161241

Browse files
committed
Fix custom parser example
1 parent c091add commit f161241

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

docs/api-guide/parsers.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,17 +144,16 @@ By default this will include the following keys: `view`, `request`, `args`, `kwa
144144
The following is an example plaintext parser that will populate the `request.data` property with a string representing the body of the request.
145145

146146
class PlainTextParser(BaseParser):
147-
"""
148-
Plain text parser.
149-
"""
150-
151-
media_type = 'text/plain'
152-
153-
def parse(self, stream, media_type=None, parser_context=None):
154147
"""
155-
Simply return a string representing the body of the request.
148+
Plain text parser.
156149
"""
157-
return stream.read()
150+
media_type = 'text/plain'
151+
152+
def parse(self, stream, media_type=None, parser_context=None):
153+
"""
154+
Simply return a string representing the body of the request.
155+
"""
156+
return stream.read()
158157

159158
---
160159

0 commit comments

Comments
 (0)