title: Uploading file on sharepoint with python causes uploaded file to retain headers in the content
body: <p>When I submit the post request using my script, I do not encode the data and prepare the post request as such:</p>
  
  <pre><code>postheader.update({'Accept':'application/json; odata=verbose','Content-Type':'application/json; odata=verbose', 'X-RequestDigest':formdigestvalue, 'binaryStringRequestBody':'true'})
  
  filetoupload = {'file':(filename, open(filename, 'rb'), 'application/vnd.openxmlformats-officedocument.presentationml.presentation')}
  posturl = projectConfig.sharepointurl + "/_api/web/getfolderbyserverrelativeurl('Shared Documents/release_doc/"+project+"')/files/add(url='"+filename+"', overwrite='true')"
  response = requests.post(posturl, headers=postheader, files=filetoupload, cookies=postcookies)
  </code></pre>
  
  <p>I took a look at the file that I uploaded using my script and it has the following headers still attached in the content:</p>
  
  <pre><code>--6ab0a06f1ddc432186194dd48355eac1
  Content-Disposition: form-data; name="ZZZ Technology Guide.pptx"; filename="ZZZ Technology Guide.pptx"
  Content-Type: application/vnd.openxmlformats-officedocument.presentationml.presentation
  
  &lt;file content&gt;
  --6ab0a06f1ddc432186194dd48355eac1--
  </code></pre>
  
  <p>However the file that was uploaded through firefox did not have these headers. I'm thinking I need to call a sharepoint function (if there is a REST API that does that) to process the file after it is uploaded or if there's a method in the python requests that can dispose off these headers as mentioned in this post: <a href="https://stackoverflow.com/questions/8947846/how-do-i-remove-http-artifacts-from-a-multipart-form-data-request">stackoverflow post</a></p>