Created
October 24, 2012 21:14
-
-
Save mikeknoop/3948931 to your computer and use it in GitHub Desktop.
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
//open connection | |
$ch = curl_init(); | |
//set the url, number of POST vars, POST data | |
$fields = array('data' => $variable); | |
curl_setopt($ch,CURLOPT_URL, $url); | |
curl_setopt(CURLOPT_HTTPHEADER, array('Content-Type' => 'application/json')); | |
curl_setopt(CURLOPT_POST, true); | |
curl_setopt(CURLOPT_POSTFIELDS, $fields ); | |
//execute post | |
$result = curl_exec($ch); | |
//close connection | |
curl_close($ch); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment