Last active
August 29, 2015 14:10
-
-
Save pasindud/54499c62bde89f0edd6a to your computer and use it in GitHub Desktop.
Ideamart Proxy
This file contains 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 | |
// Use this like this | |
// proxy.php?url= | |
$ch = curl_init( $_GET['url']); | |
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); | |
curl_setopt($ch, CURLOPT_POST, 1); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, file_get_contents('php://input')); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$res = curl_exec($ch); | |
echo $res; | |
error_log("Reponse ". file_get_contents('php://input')." || Request ".$res); | |
curl_close($ch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment