Last active
June 8, 2017 14:57
-
-
Save JacobHsu/518f7d870a453415a722 to your computer and use it in GitHub Desktop.
PHP curl POST #PHP
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 | |
$fileUrl = 'https://googledrive.com/host/0B8p3dPzRohcndXRaNm1OamFXUUE'; | |
$postArr = array( | |
"fileurl"=>$fileUrl,"btype"=> '360p,720p', | |
"recipient"=>'http://php/httpreq/jsonrep.php' | |
); | |
$options = array( | |
CURLOPT_POSTFIELDS => http_build_query($postArr), | |
CURLOPT_RETURNTRANSFER=>true //This will make curl_exec return the data instead of outputting | |
); | |
$ch = curl_init( 'http://127.0.0.1:8080/post'); | |
curl_setopt_array($ch, $options); | |
$result = curl_exec($ch); | |
curl_close($ch); | |
echo 'result='.$result; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment