title: How to access field names in MultipartDecoder
body: <p>I am decoding form fields submitted via a HTTP POST request using <a href="https://github.com/requests/toolbelt" rel="noreferrer">request-toolbelt</a>. I successfully instantiated a <code>MultipartDecoder</code> like described <a href="https://stackoverflow.com/questions/50925083/parse-multipart-request-string-in-python">here</a>. Now I would like to access the form fields by the name I have given them when sending the request.</p>
  
  <p>I am able to get the name of a field like this</p>
  
  <pre><code>from requests_toolbelt.multipart import decoder
  multipart_string = b"--ce560532019a77d83195f9e9873e16a1\r\nContent-Disposition: form-data; name=\"author\"\r\n\r\nJohn Smith\r\n--ce560532019a77d83195f9e9873e16a1\r\nContent-Disposition: form-data; name=\"file\"; filename=\"example2.txt\"\r\nContent-Type: text/plain\r\nExpires: 0\r\n\r\nHello World\r\n--ce560532019a77d83195f9e9873e16a1--\r\n"
  content_type = "multipart/form-data; boundary=ce560532019a77d83195f9e9873e16a1"
  decoder = decoder.MultipartDecoder(multipart_string, content_type)
  field_name = decoder.parts[0].headers[b'Content-Disposition'].decode().split(';')[1].split('=')[1]
  </code></pre>
  
  <p>But this seems quite wrong. What is the usual way to access the form field names?</p>