title: Python Requests. POSTing JSON NameError for boolean
body: <p>I'm trying to POST JSON content to an API using Python and requests but I'm getting a <code>NameError</code> because my JSON contains a boolean.</p>
  
  <p>I've tried with urllib3 and just requests and both display the same behaviour.</p>
  
  <pre><code>"enabled": true,
  NameError: name 'true' is not defined
  </code></pre>
  
  <p>I'm building in docker:</p>
  
  <pre><code>FROM python:slim
  
  ADD script.py requirements.txt ./
  
  RUN pip install -r requirements.txt
  
  # Run app.py when the container launches
  CMD ["python", "script.py"]
  </code></pre>
  
  <p>requirements.txt</p>
  
  <pre><code>requests==v2.23.0
  urllib3==1.25.8
  </code></pre>
  
  <p>script.py</p>
  
  <pre><code>#import urllib3
  import json
  
  resp = req.post('https://example.com/api/endPoint',
    json={
        "name": "myName",
        "rules": [{
          "type": "foo",
          "enabled": true}]
    })
  </code></pre>