33
loading...
This website collects cookies to deliver better user experience
scope
, send
and recieve
.{
"type" : "http",
"method" : "GET",
"path" : "/api",
"query_string" : "userid=999",
"headers" : [
b"accept-encoding": b"gzip, deflate, br",
b"connection": b"keep-alive",
b"cookie": b"a=b",
],
}
await send({
'type': 'http.response.start',
'status': 200,
'headers': [
b"content-type": b"text/html",
b"date" : b"Fri, 10 Dec 2021 06:16:51 GMT",
b"cache-control" : b"none",
b"set-cookie": b"a=b"
]
})
await send({
'type': 'http.response.body',
'body': b"Hello user",
})
async def app(scope, recieve, send):
# Some logic here
class App:
# other things
async def __call__(self, scope, recieve, send):
#Some logic here