Skip to content

Instantly share code, notes, and snippets.

View zatikbalazs's full-sized avatar

Balazs Zatik zatikbalazs

View GitHub Profile
@jnaskali
jnaskali / gist:2000102
Created March 8, 2012 10:08
PHP: Send XML over POST with cURL and save response
function sendXmlOverPost($url, $xml) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// For xml, change the content-type.
curl_setopt ($ch, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);