Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//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
You can’t perform that action at this time.