Skip to content

Instantly share code, notes, and snippets.

@danielpereirabp
Created June 14, 2016 18:06
Show Gist options
  • Save danielpereirabp/9f3ea60b61cca9de1d69c73aa7479549 to your computer and use it in GitHub Desktop.
Save danielpereirabp/9f3ea60b61cca9de1d69c73aa7479549 to your computer and use it in GitHub Desktop.
Curl
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->endpoint);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_PROXY, 'http://user:[email protected]:3128');
$result = curl_exec($ch);
curl_close($ch);
$xml = simplexml_load_string($result);
echo '<pre>';
print_r($xml);
echo '</pre>';
exit;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment