title: HTTP Error 422: Unprocessable Entity - when calling API from Python (but curl works)
body: <p>When trying out the digitalocean v2 api I come across the following behaviour:</p>
  
  <pre><code>curl -X POST "https://api.digitalocean.com/v2/droplets" \
      -d'{"name":"t002","region":"ams3","size":"512mb","image":"debian-7-0-x64","ssh_keys":[123]}' \
      -H "Authorization: Bearer $TOKEN" \
      -H "Content-Type: application/json"
  </code></pre>
  
  <p>Works fine and the droplet gets created.</p>
  
  <hr>
  
  <p>Now when I do call it from python with:</p>
  
  <pre><code>json_values = {'name': 's002', 'region': 'ams3', 'size': '512mb', 'image': 'debian-7-0-x64', 'ssh_keys': [123]}
  
  data = urllib.parse.urlencode(json_values)
  data = data.encode("utf-8")
  
  try:
      req = urllib.request.Request(create_droplets_url, data)
      req.add_header("User-Agent", uagent)  # set custom user agent
      req.add_header("Authorization", BearerToken)  # set custom user agent
  
      response = urllib.request.urlopen(req)
  </code></pre>
  
  <p>I get back: <code>HTTP Error 422: Unprocessable Entity</code> with no further information. Am i doing something wrong on the python side? Thx</p>
  
  <hr>
  
  <p>Additional Info:
  I figured out that the problem must be with ssh_keys. If I remove that element everything works fine.</p>