title: Formatting a nested json for use with Python Requests
body: <p>I have been working on solving an HTTP 500 (bad syntax/string) error for far too long, and after doing some searching I cannot find a solution anywhere.  I have a nested json PUT request that I have been able to make work using a couple API tools (both browser extensions and stand-alone programs), but when I try to use the json in Python's HTTP Requests module, I keep getting the 500 error code returned.</p>
  
  <p>I have gotten other, simplier jsons (e.g. data={"RequestID": "71865"}) to work using similar code to the following, which leaves me to believe something is not getting formatted correctly, and I am unfortunately too new to this json-python thing to figure it out. I think the issue is because of the way python handles the nested json.</p>
  
  <pre><code># -*- coding: utf-8 -*-
  #!/usr/bin/env python
  import requests
  import json
  
  USER_NAME=u"myusername"
  USER_PASS=u"mypassword"
  
  PUT_URL="https://webservice.url.com/A/Path/To/Create/"
  
  headers = {"Content-Type": "application/json"}
  data = {
  "ListOfFields": {
          "Field": [
              {"fieldname": "summary","value": "test summary"},
              {"fieldname": "notes","value": "an example json PUT"},
              {"fieldname": "user","value": "myuser"}
          ]
      }
  }
  data_json = json.dumps(data)
  payload = {'json_playload': data_json } ## I have tried with and without this line.
  
  r = requests.put('{}'.format(PUT_URL), data=data_json, headers=headers, auth=(USER_NAME, USER_PASS), timeout=10)
  # r = requests.put('{}'.format(PUT_URL), data=payload, headers=headers, auth=(USER_NAME, USER_PASS), timeout=10)
  </code></pre>
  
  <p>I have tried putting the data value into quotes, a single line, and making some other slight tweaks, but I keep getting the 500 error.</p>
  
  <pre><code>print(r.status_code)
  &gt;&gt; 500
  </code></pre>
  
  <p>As mentioned before, I have gotten similar code to work in python using GET and POST and the same web server, but this one is giving me a headache!</p>