title: Error says that POST request doesn't contain a multipart/form-data or multipart/mixed stream even though I explicitly define it as such
body: <p>I'm trying to implement a link in a Groovy server page that sends a POST request containing the text of the link they clicked on to another GSP, then load that page. I have tried several different solutions to this problem from other questions on StackOverflow, but every single one ends up raising a <code>org.apache.tomcat.util.http.fileupload.FileUploadBase$InvalidContentTypeException: the request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is null</code> error. What's going on here? I'm also interested in different approaches for this.</p>
  
  <p>Request:</p>
  
  <pre><code>&lt;script type="text/javascript" src="resources/post.js"&gt;&lt;/script&gt;
  &lt;a href="actions/manage.gsp" onclick="post('/actions/manage', {name: '${file}'});"&gt;${file}&lt;/a&gt;
  </code></pre>
  
  <p>post.js:</p>
  
  <pre><code>function post(path, params, method) {
      method = method || "post";
      var form = document.createElement("form");
      form.setAttribute('enctype','multipart/form-data').
      form.setAttribute("method", method);
      form.setAttribute("action", path);
  
      for(var key in params) {
          if(params.hasOwnProperty(key)) {
              var hiddenField = document.createElement("input");
              hiddenField.setAttribute("type", "hidden");
              hiddenField.setAttribute("name", key);
              hiddenField.setAttribute("value", params[key]);
  
              form.appendChild(hiddenField);
          }
      }
  
      document.body.appendChild(form);
      form.submit();
  }
  </code></pre>
  
  <p>manage.gsp:</p>
  
  <pre><code>&lt;%! static output = "text/html" %&gt;
  Testing!
  &lt;% log.info("Found ${request.parts.size()} parts") %&gt;
  </code></pre>