IOError: stream is closed or unusable on POST

I frequently get

 IOError: stream is closed or unusable

when trying to POST to an API with a pretty large body: Content-Length: 406233.

What can I do?