title: How to encode data in Python 3.7 using requests_toolbelt
body: <p>In my request, I have some Boolean values and numbers. Here is a simple example:</p>
  
  <pre><code>import requests
  from requests_toolbelt.multipart.encoder import MultipartEncoder
  m = MultipartEncoder(
      fields={'field0': 'value', 'field1': True,
              'field2': ('filename', 'test', 'text/plain')}
      )
  r = requests.post('http://httpbin.org/post', data=m, headers={'Content-Type': m.content_type})
  print(r.text)
  </code></pre>
  
  <p>I get an error:</p>
  
  <pre><code> File "&lt;stdin&gt;", line 3, in &lt;module&gt;
    File "/usr/local/lib/python3.7/site-packages/requests_toolbelt/multipart/encoder.py", line 125, in __init__
      self._prepare_parts()
    File "/usr/local/lib/python3.7/site-packages/requests_toolbelt/multipart/encoder.py", line 246, in _prepare_parts
      self.parts = [Part.from_field(f, enc) for f in self._iter_fields()]
    File "/usr/local/lib/python3.7/site-packages/requests_toolbelt/multipart/encoder.py", line 246, in &lt;listcomp&gt;
      self.parts = [Part.from_field(f, enc) for f in self._iter_fields()]
    File "/usr/local/lib/python3.7/site-packages/requests_toolbelt/multipart/encoder.py", line 494, in from_field
      body = coerce_data(field.data, encoding)
    File "/usr/local/lib/python3.7/site-packages/requests_toolbelt/multipart/encoder.py", line 472, in coerce_data
      return CustomBytesIO(data, encoding)
    File "/usr/local/lib/python3.7/site-packages/requests_toolbelt/multipart/encoder.py", line 535, in __init__
      buffer = encode_with(buffer, encoding)
    File "/usr/local/lib/python3.7/site-packages/requests_toolbelt/multipart/encoder.py", line 416, in encode_with
      return string.encode(encoding)
  AttributeError: 'bool' object has no attribute 'encode'
  </code></pre>
  
  <p>I am unsing:</p>
  
  <ul>
  <li>requests_toolbelt v.0.9.1</li>
  <li>requests v.2.22.0</li>
  </ul>