title: Do form parameter names need to be encoded when doing a POST?
body: <p><strong>Quick version:</strong> Do the names of parameters of "forms" being sent using the standard <em>multipart/form-data</em> encoding need to be encoded?</p>
  
  <p><strong>Longer version:</strong> The upload form on <a href="http://www.1fichier.com/en" rel="nofollow">1fichier.com</a> (a service to upload large files) uses the following to specify the file parameter to upload:</p>
  
  <pre><code>&lt;input type="file" name="file[]" size="50" title="Select the files to upload" /&gt;
  </code></pre>
  
  <p>The name of the parameter is <strong>file[]</strong> (notice the brackets).</p>
  
  <p>Using LiveHTTPHeaders I see that the parameter is sent like this (i.e. with brackets) when submitting the form in Firefox. However, for a <a href="https://launchpad.net/nautilus-image-manipulator" rel="nofollow">program</a> I'm writing in Python, I am using the <a href="http://atlee.ca/software/poster/" rel="nofollow">poster</a> module to be able to upload files using the standard <em>multipart/form-data</em> encoding. If I enter the parameter name with the brackets, it gets sent like this:</p>
  
  <pre><code>file%5B%5D
  </code></pre>
  
  <p>Internally, poster encodes the names of the parameters using this function:</p>
  
  <pre><code>def encode_and_quote(data):
      """If ``data`` is unicode, return urllib.quote_plus(data.encode("utf-8"))
      otherwise return urllib.quote_plus(data)"""
      if data is None:
          return None
  
      if isinstance(data, unicode):
          data = data.encode("utf-8")
      return urllib.quote_plus(data)
  </code></pre>
  
  <p>The <a href="http://docs.python.org/library/urllib.html#urllib.quote_plus" rel="nofollow">urllib.quote_plus</a> documentation says that this is only "required for quoting HTML form values when building up a query string to go into a URL". But here we're doing a POST, so the form values don't go in the url.</p>
  
  <p>So, do they still need to be encoded, or is it an error of poster to be doing this?</p>