title: 415 error when uploading to API
body: <p>I am trying to write an automatic subtitle finder in Python 3.x using The SubDB (<a href="http://thesubdb.com/api/" rel="nofollow">http://thesubdb.com/api/</a>). I'm now working on an upload feature. However, I cannot get it to work. I keep getting a 415 error (Unsupported Media Type). On the SubDB website, a 'request sample' is given:</p>
  
  <pre><code>POST /?action=upload HTTP/1.1
  Host: api.thesubdb.com
  User-Agent: SubDB/1.0 (Pyrrot/0.1; http://github.com/jrhames/pyrrot-cli)
  Content-Length: 60047
  Content-Type: multipart/form-data; boundary=xYzZY
  
  - - --xYzZY
  Content-Disposition: form-data; name="hash"
  
  edc1981d6459c6111fe36205b4aff6c2
  - - --xYzZY
  Content-Disposition: form-data; name="file"; filename="subtitle.srt"
  Content-Type: application/octet-stream
  
  
  [PAYLOAD]
  </code></pre>
  
  <p>But I do not know how to interpret this and I couldn't find an answer online. This is my current code:</p>
  
  <pre><code>def uploadSubtitle(hash, path):
      params = {'action': "upload", 'hash': hash}
      response = requests.post(
          url=base_url.format(urllib.parse.urlencode(params)),
          data=open(path,'r').read(),
          headers = {
              'User-Agent': user_agent,
              'Content-Length': 51200,
              'Content-Type': "multipart/form-data; boundary=xYzZY",
              'Host': "api.thesubdb.com"
          }
      )
      return response.status_code
  </code></pre>
  
  <p>Any advice would be greatly appreciated!</p>