title: Using python requests to POST data with file
body: <p>I have the following working curl</p>
  
  <pre><code>curl -v -i -H "Content-Type:multipart/form-data" -H "X-Authorization: 12345" -F "file0=@/path/to/image.jpg" -d 'jsonData={ "data": { "field1": 1, "field2": 2 } }' -X POST http://example.com/url/path
  </code></pre>
  
  <p>I am trying to make the exact same request in python and came up with the following</p>
  
  <pre><code>    headers = {
          'Content-Type': 'multipart/form-data',
          'X-Authorization': '12345',
      }
  
      files = {
          'file0': ('/path/to/image.jpg',
                    open('/path/to/image.jpg', 'rb')),
  
      }
  
      file_post = requests.post('http://example.com/url/path',
                                  headers=headers,
                                  files=files,
                                  data={
                                      "jsonData": {
                                          "data": {
                                              "field1": 1,
                                              "field2": 2,
                                          }
                                      }
                                  })
  </code></pre>
  
  <p>The problem is that I'm getting a different response for curl and for python. Are these requests not equivalent or should I be looking somewhere else?</p>