hurl/integration/tests_ok/post_large.py
jcamiel 18115d6427
Use CURLOPT_COPYPOSTFIELDS instead of CURLOPT_READFUNCTION/CURLOPT_READDATA.
We give the whole body once, instead of providing it by reading data with callback.
There seems to be no performance cost (in both ways, the data is memcpy), but the timings looks much better: we can see all request having "transfer" timing. Before this, requests that have body suspicioulsy have no realistic data transfer...
2023-06-17 00:39:25 +02:00

10 lines
225 B
Python

from app import app
from flask import Response, request
@app.route("/post_large", methods=["POST"])
def post_large():
data = request.data
assert len(data) == 15728640
return Response(f"{len(data)}", status=200)