title: How to send excel file in multipart/form-data with POST Requests in python?
body: <p>I am trying to send an excel file to server in POST Request in multipart/form-data content-type. I am getting an error: </p>
  
  <blockquote>
    <p>too many values to unpack</p>
  </blockquote>
  
  <p>What could be the reason? Below is the request what I am trying:</p>
  
  <pre><code>#Data = get_data('C:\foo.xls')
  #print Data
  Data = open('C:\foo.xls', 'rb')
  print Data
  
  headers = {
         'access-control-allow-origin': '*',
         'accept': 'application/json',
         'content-type': 'multipart/form-data', 
         'authorization': 'Basic xxxxxxxxx'
        }   
   R = requests.post('http://testserver:8080/v1/readyapi/executions/'+executionId+'/files', headers=headers, params=params, files=Data)
   print R.content
  </code></pre>
  
  <p>here is the error:</p>
  
  <pre><code>Traceback (most recent call last):
      (body, content_type) = self._encode_files(files, data)
    File "C:\Python27\lib\site-packages\requests\models.py", line 132, in _encode_files
      for (k, v) in files:
  ValueError: too many values to unpack
  </code></pre>
  
  <p>I could not figure out by myself. tried few things, didn't work. Can someone please advise?</p>