ealeon
ealeon

Reputation: 12462

Python requests post data too large

def request_post(url, payload, headers):
    requests.post(url, data=payload, headers=headers)

request_post('mywebserver.com', ['a', 'b'])

When payload becomes a list of thousands of string, server throws a ClientAbortException.
Is there something that needs to be configured from the client side to be able to send a large post data?

Upvotes: 0

Views: 1346

Answers (1)

Manish Dash
Manish Dash

Reputation: 2073

The error points to a connection being dropped by the client. it can happen due to a variety of reasons. Some reasons

Specifically for a large file transfer, sometimes the length header is important to let the client know to keep streaming the payload. Source

You can try adding a header :

"Content-Length" : <length in bytes>

Upvotes: 1

Related Questions