Created
March 20, 2018 20:31
-
-
Save piiskop/41575d4393e3689352dea13b6a0f74ea 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
<?php | |
ini_set('display_errors', 1); | |
error_reporting(E_ALL & ~E_DEPRECATED & ~E_STRICT); | |
// @formatter:off | |
$url = sprintf( | |
'http://%1$s:%2$u/study-groups?format=json&id=3', | |
$_SERVER['SERVER_NAME'], // 1 | |
$_SERVER['SERVER_PORT'] // 2 | |
); | |
// @formatter:on | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, $url); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); | |
curl_setopt($ch, CURLOPT_HTTPHEADER, array ( | |
'Content-Type: application/json' | |
)); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
$result = curl_exec($ch); | |
curl_close($ch); | |
header("Content-Type:application/json"); | |
print_r($result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment