This gist https://gist.github.com/schnittchen/6fea3e40b1f045246133dc37197a673b reproduces the problem. cURL also complains about missing bytes in the response when it happens.
It's a sporadic issue, and seems to only happen with a sufficiently long body size.