title: Convert bool values to string in json.dumps()
body: <p>I'm trying to convert a python dict into json, however the API I'm accessing doesn't take bool value instead it uses "true"/"false" string.</p>
  
  <p>Example:</p>
  
  <pre><code>dct = { "is_open": True }
  json.dumps(dct)
  </code></pre>
  
  <p>currently gives a bool output: <code>{ "is_open": true }</code></p>
  
  <p>but what I want is lower-case string output:
    <code>{ "is_open": "true" }</code></p>
  
  <p>I tried <code>json.dumps(dct, cls=MyEncoder)</code> but it doesn't work, only non-native object get passed to MyEncoder default.</p>
  
  <pre><code>class MyEncoder(json.JSONEncoder):
          def default(self, o):
              if isinstance(o, bool):
                  return str(o).lower()
              return super(MyEncoder, self).default(o)
  </code></pre>
  
  <p>Any help would be great.</p>
  
  <p>(Btw this is not my API I'm accessing, so I can't modify the API to access true false value instead of the string alternative.)</p>