<?php
$post_data = array();
$post_data['pictures[0]'] = "@cat.jpg";
$post_data['pictures[1]'] = "@dog.jpg";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://my.domain.com/my_url.php" );
curl_setopt($ch, CURLOPT_POST, 1 );
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$postResult = curl_exec($ch);
if (curl_errno($ch)) {
print curl_error($ch);
}
curl_close($ch);
print "$postResult";
?>
This is an example from the PHP Site which should answer your question. External to the sample, our services should all take in standard headers in both GET and POST formats. If you pass the $post_data as:
param1=value1¶m2=value2¶m3=value3
this will let you pass all of the values at once.
Let me know if this answers your question. The original URL where the above sample came from is: http://us2.php.net/curl
Regards,
Barry R.