title: Python requests: Connection reset by peer for multi-part file POST
body: <p>Same problem as this unanswered question: <a href="https://stackoverflow.com/questions/29567003/connection-reset-for-multi-part-file-upload-using-requests-python-library">Connection reset for multi-part file upload using requests python library</a></p>
  
  <p>I'm POSTing a multipart form request to a locally running server and it works fine for small files, but if I try to send a larger file (~20MB) then I get the following error:</p>
  
  <pre><code>File "~/.virtualenvs/sound-api/lib/python3.5/site-packages/urllib3/connectionpool.py", line 601, in urlopen
      chunked=chunked)
  File "~/.virtualenvs/sound-api/lib/python3.5/site-packages/urllib3/connectionpool.py", line 357, in _make_request
      conn.request(method, url, **httplib_request_kw)
  File "/usr/lib/python3.5/http/client.py", line 1106, in request
      self._send_request(method, url, body, headers)
  File "/usr/lib/python3.5/http/client.py", line 1151, in _send_request
      self.endheaders(body)
  File "/usr/lib/python3.5/http/client.py", line 1102, in endheaders
      self._send_output(message_body)
  File "/usr/lib/python3.5/http/client.py", line 936, in _send_output
      self.send(message_body)
  File "/usr/lib/python3.5/http/client.py", line 905, in send
      self.sock.sendall(datablock)
  ConnectionResetError: [Errno 104] Connection reset by peer
  </code></pre>
  
  <p>Here is the code making the request:</p>
  
  <pre><code>files = {
      'file': my_file
  }
  data = {
      'parameter': 'some data'
  }
  session = requests.Session()
  result = self.session.post(
      url,
      files=files,
      data=data
  )
  return result
  </code></pre>
  
  <p>I'm running Python 3.5.2 with requests 2.18.4 in a virtualenv.
  Am I missing some setting or library to allow me to send larger files?</p>