title: Javascript: submit form specyfing content type
body: <p>I use this code to submit a form</p>
  
  <pre><code>var form = $("#some-form");
  form.attr("action", url);
  form.attr("method", "post");
  form.attr('target', '_blank');
  form.submit();
  </code></pre>
  
  <p>The problem is that the request sent has <code>Content-Type: application/x-www-form-urlencoded</code>, which (as mentioned <a href="https://stackoverflow.com/questions/6963480/firefox-and-chrome-replacing-lf-with-crlf-during-post">here</a>) encodes <code>\n</code> characters in textareas of the form as <code>%0D%0A</code>, which are decoded as <code>\r\n</code> on the server side and cause many troubles.</p>
  
  <p>I want the server to receive <code>\n</code>, so I need another content type.</p>
  
  <p>So, the questions are:</p>
  
  <ul>
  <li>what content type should I use?</li>
  <li>how should I change my javascirpt to use that content type?</li>
  </ul>
  
  <p><strong>EDIT</strong></p>
  
  <p>I tried <code>enctype="multipart/form-data"</code>, but it encodes new line characters the same way.</p>