repr() method for Request, refs #1519

This commit is contained in:
Simon Willison 2021-11-19 12:29:37 -08:00
commit ff0dd4da38
2 changed files with 11 additions and 0 deletions

View file

@ -37,6 +37,9 @@ class Request:
self.scope = scope
self.receive = receive
def __repr__(self):
return '<asgi.Request method="{}" url="{}">'.format(self.method, self.url)
@property
def method(self):
return self.scope["method"]