title: File uploading using Python requests.put function is rejected with Error 400
body: <p>I have a task to convert linux curl command into a Python function.
  The commands itself is stright forward - it does upload a file onto a server:</p>
  <pre><code>curl -X PUT &quot;http://xxx.yyy.zzz/planning/antennas/file&quot; -H  &quot;accept: */*&quot; -H  &quot;Content-Type: multipart/form-data&quot; -F &quot;file=@111.pafx&quot;
  </code></pre>
  <p>The Python module I came up with as following:</p>
  <pre><code>  def PutAntennaFile(self,filename):
          files = {'file': open(filename, 'rb')}
          headers = {&quot;Accept&quot;: &quot;*/*&quot;,
                     'Content-Type': 'multipart/form-data'
                     }
          r = requests.put(url=self.__url+'/planning/antennas/file', files=files, headers=headers,verify=False)
          print(r.text)
  </code></pre>
  <p>However, I'm constantly getting Error 400 'Bad Request' responce:</p>
  <pre><code>'b'{&quot;error&quot;:&quot;Failed to read the request form. Missing content-type boundary.&quot;,&quot;type&quot;:&quot;https://httpstatuses.com/400&quot;,&quot;title&quot;:&quot;Plannig API error&quot;,&quot;status&quot;:400,&quot;detail&quot;:&quot;OK&quot;,&quot;instance&quot;:&quot;/planning/antennas/file&quot;,&quot;extensions&quot;:{}}'` 
  </code></pre>
  <p>and request itself is following:</p>
  <pre><code>b'--072fc9ea6990430c232050439f80f414\r\nContent-Disposition: form-data; name=&quot;file&quot;; filename=&quot;222.pafx&quot;\r\n\r\nPK\x03\x04\x14\x00\x00\x00\x08\x00\x00\x00!\x00[7\xa9\xdd\x1e\x03\x00\x00\\\n\x00...'
  </code></pre>
  <p>Perhaps somebody can clarify what I'm doing wrong?</p>