title: How to send multipart/mixed with CURL with predifined boudary?
body: <p>I need to send files to a server which contains multipart/mixed content. For exemple:</p>
  
  <pre><code>------------------------------1b479dca9c3e
  Content-Disposition: form-data; name="one_part"
  Content-Type: text/xml; charset=utf-8
  XX-Project-Type: METADATA
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;My_MSG version="1"&gt;
    &lt;MSG date="2014-08-20T18:39:59.154326+00:00"&gt;
      &lt;METADATA mess_id="sd1212sd05AZ"&gt;
        &lt;CONVERSION&gt;
          &lt;FILE name="foo.bar"/&gt;
          &lt;FILE name="ping.pong"/&gt;
          &lt;FILE name="abc.def"/&gt;
        &lt;/CONVERSION&gt;
      &lt;/METADATA&gt;
    &lt;/MSG&gt;
  &lt;/My_MSG&gt;
  
  ------------------------------1b479dca9c3e
  Content-Disposition: form-data; name="one_part"
  Content-Type: text/xml; charset=utf-8
  XX-Project-Type: METADATA
  
  &lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;My_MSG version="1"&gt;
    &lt;MSG date="2015-08-20T19:39:59.154326+00:00"&gt;
      &lt;METADATA mess_id="az987456321"&gt;
        &lt;CONVERSION&gt;
          &lt;FILE name="bar.foo"/&gt;
          &lt;FILE name="pong.ping"/&gt;
          &lt;FILE name="def.abc"/&gt;
        &lt;/CONVERSION&gt;
      &lt;/METADATA&gt;
    &lt;/MSG&gt;
  &lt;/My_MSG&gt;
  
  ------------------------------1b479dca9c3e--
  </code></pre>
  
  <p>As you can see the multipart boudary is already defined into the file to send, so to send it with CURL I use following command:</p>
  
  <pre><code>curl -d @/tmp/exemple.file -XPOST http://myServer:8000/multipartService -H "content-type: multipart/Mixed ; boundary=----------------------------1b479dca9c3e"
  </code></pre>
  
  <p>But the server does not succeed to handle parts. For the moment I don't have server's logs, but I perform a tcpdump to see what is send to the server:</p>
  
  <p><a href="https://i.stack.imgur.com/fzM3R.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fzM3R.png" alt="tcpdumpResult"></a></p>
  
  <p>It seems that spaces and carriage returns are deleted in the send request and it could explain that the request content can't be handle as multipart/mixed by the server... </p>
  
  <p>Do you know how to send my file with multipart/mixed compliant format?</p>
  
  <hr>
  
  <p>Edit for hanshenrik:</p>
  
  <p><a href="https://i.stack.imgur.com/unNud.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/unNud.png" alt="enter image description here"></a></p>