title: Set mime-type of multipart header in php curl without passing a file
body: <p>Can this be done?  I'm seeing examples like </p>
  
  <pre><code>curl_setopt($ch, CURLOPT_POSTFIELDS, array(
    'variable' =&gt; '@path/to/file;type=application/json'
  ));
  </code></pre>
  
  <p>But I'm unable to set this mime-type if I'm passing a string as the variable value.  The API with which I'm interfacing is explicitly requiring that this mime-type be set to application/json, but I can't seem to set it with the curl library unless I use a file.  For example:</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_POSTFIELDS, array(
    'variable' =&gt; 'json_string;type=application/json'
  ));
  </code></pre>
  
  <p>outputs only a string with type=application/json appended to the end (which makes sense), and something like</p>
  
  <pre><code>curl_setopt($ch, CURLOPT_POSTFIELDS, array(
    'variable' =&gt; sprintf('@%s;type=application/json', $json_string)
  ));
  </code></pre>
  
  <p>fails to pass anything in to the body to the server, ostensibly because it can't find the file (?).</p>
  
  <p>Any ideas on how to explicitly set this mime-type without writing out temp files or writing my own post requests?</p>