title: Send BOTH Parameters and Body Content with PHP POST cURL
body: <p>I need to send <strong>both</strong> key value pair parameters <strong>and</strong> HTTP body content (in this case, an XML string) using PHP. cURL is my go to method for similar tasks, but I can't figure out how to send both with a single cURL Post request.</p>
  
  <p>I can use CURLOPT_POSTFIELDS to send an array of key value pairs: </p>
  
  <p><code>curl_setopt($c, CURLOPT_POSTFIELDS, array('foo' =&gt; 'bar', 'fruit' = 'orange));</code></p>
  
  <p><strong>OR</strong> I can use CURLOPT_POSTFIELDS to send an XML string.</p>
  
  <pre><code>curl_setopt($c, CURLOPT_POSTFIELDS,$xml);
  </code></pre>
  
  <p>The API docs require both request parameters and a body in the single post request. This API also throttles requests so I'm limited in my debug attempts per hour. Please help.</p>
  
  <p>Edit: API Docs (see examples at bottom): <a href="http://docs.developer.amazonservices.com/en_US/feeds/Feeds_SubmitFeed.html" rel="nofollow noreferrer">http://docs.developer.amazonservices.com/en_US/feeds/Feeds_SubmitFeed.html</a></p>