Answer the question
In order to leave comments, you need to log in
What to do if you need to send a very long request to api?
Preface = error description
Got more than 8190 bytes (25569123) when reading Status line is too long.
async def handle(request):
data = json.loads(request.query['data'])
brand = json.loads(request.query['brand'])
ip = request.query['ip']
final_data = launch_processors(brand, data)
return web.Response(text=json.dumps(final_data, ensure_ascii=False))
Answer the question
In order to leave comments, you need to log in
It is better to transfer large amounts of data via POST. There is a limit on the size of the request body of several megabytes (depending on the settings, it can be up to 2 gigabytes).
First you need to look at the source:
class HeadersParser:
def __init__(self,
max_line_size: int=8190,
max_headers: int=32768,
max_field_size: int=8190) -> None:
...
class HttpParser(abc.ABC):
def __init__(self, protocol: BaseProtocol,
loop: asyncio.AbstractEventLoop,
max_line_size: int=8190,
max_headers: int=32768,
max_field_size: int=8190,
...
As a result, what happened ...
I passed the post data but used params = out of ignorance, but I should have data =.
requests.post("http://localhost:8080/find", data=payload)
web.Application(client_max_size=1024**8)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question