From 3a16408540f14da7364fd78d7a4c700012a6bea3 Mon Sep 17 00:00:00 2001 From: Bruno Fontes Date: Fri, 1 Mar 2019 21:25:19 -0300 Subject: [PATCH] Testing some options --- index.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.php b/index.php index 882455b..539ea25 100644 --- a/index.php +++ b/index.php @@ -5,6 +5,7 @@ if (!isset($_SESSION['token'])) { } $resource = getResource($_SESSION['token']); +// print_r($resource); die(); echo "
\nuserName: {$resource['user']['userName']}"; echo "
\nName: {$resource['user']['firstName']}"; echo "
\nLast name: {$resource['user']['lastName']}"; @@ -16,6 +17,8 @@ echo "
\nOrganization: {$resource['organization']['name']}"; function getResource($access_token) { $test_api_url = 'https://cloud.memsource.com/web/api2/v1/auth/whoAmI'; + // $test_api_url = 'https://cloud.memsource.com/web/api2/v1/projects'; + // $test_api_url = 'https://cloud.memsource.com/web/api2/v1/projects/zFbwYXoMLoa3cJ60Vvldo2?purge=true'; $header = ["Authorization: Bearer {$access_token}"]; @@ -25,6 +28,7 @@ function getResource($access_token) CURLOPT_HTTPHEADER => $header, CURLOPT_SSL_VERIFYPEER => false, CURLOPT_RETURNTRANSFER => true + // CURLOPT_CUSTOMREQUEST => 'DELETE' <-- This is how to send a DELETE request ]); $response = curl_exec($curl); curl_close($curl);