Created
June 14, 2016 18:06
-
-
Save danielpereirabp/9f3ea60b61cca9de1d69c73aa7479549 to your computer and use it in GitHub Desktop.
Curl
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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