Replace stream decorator to stream parameter
This commit is contained in:
@@ -6,5 +6,5 @@ data = ""
|
||||
for i in range(1, 250000):
|
||||
data += str(i)
|
||||
|
||||
r = requests.post('http://127.0.0.1:8000/method_view', data=data)
|
||||
r = requests.post('http://127.0.0.1:8000/stream', data=data)
|
||||
print(r.text)
|
||||
|
||||
@@ -22,7 +22,7 @@ class SimpleView(HTTPMethodView):
|
||||
return text(result)
|
||||
|
||||
|
||||
@app.stream('/stream')
|
||||
@app.post('/stream', stream=True)
|
||||
async def handler(request):
|
||||
async def streaming(response):
|
||||
while True:
|
||||
@@ -34,7 +34,7 @@ async def handler(request):
|
||||
return stream(streaming)
|
||||
|
||||
|
||||
@bp.stream('/bp_stream')
|
||||
@bp.put('/bp_stream', stream=True)
|
||||
async def bp_handler(request):
|
||||
result = ''
|
||||
while True:
|
||||
|
||||
Reference in New Issue
Block a user