title: Using python 'requests' to send JSON boolean
body: <p>I've got a really simple question, but I can't figure it out how to do it. The problem I have is that I want to send the following payload using Python and Requests:</p>
  
  <pre><code>{ 'on': true }
  </code></pre>
  
  <p>Doing it like this:</p>
  
  <pre><code>payload = { 'on':true }
  r = requests.put("http://192.168.2.196/api/newdeveloper/lights/1/state", data = payload)
  </code></pre>
  
  <p>Doesn't work, because I get the following error:</p>
  
  <pre><code>NameError: name 'true' is not defined
  </code></pre>
  
  <p>Sending the <em>true</em> as <em>'true'</em> is not accepted by my server, so that's not an option. Anyone a suggestion? Thanks!</p>