From c70c7637a3e7eb81b527cd0c0f82b78917d87748 Mon Sep 17 00:00:00 2001 From: "fred.boniface" Date: Mon, 19 Sep 2022 19:46:34 +0100 Subject: [PATCH] Further changes of test scrupt --- php/submitIssue-cli-test.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/php/submitIssue-cli-test.php b/php/submitIssue-cli-test.php index c3ea73a..d1f4c08 100644 --- a/php/submitIssue-cli-test.php +++ b/php/submitIssue-cli-test.php @@ -2,6 +2,8 @@ // Get API Key for git.fjla.uk $giteaKey = "Authorization: token d9e748bbca7b662dbd946854e57ae0213d0e8f88"; + echo "Gitea AUTH header is: $giteaKey"; + // Set httpHeaders $httpHeaders = array( "accept: application/json", @@ -13,6 +15,8 @@ $body = "This is a PHP-CLI test issue."; $subject = "Test Issue"; + echo "Prepared POST data:\nSubject: $subject\nBody:$body"; + // Prepare the request $rawData = array( 'body' => $body, @@ -22,6 +26,8 @@ $issueData = json_encode($rawData); + echo "Ready to send data:\n$issueData" + // Prepare CURL $curlConnection = curl_init('https://git.fjla.uk/api/v1/repos/fred.boniface/athena.fb-infra.uk/issues'); curl_setopt($curlConnection, CURLOPT_POSTFIELDS, $issueData); @@ -32,6 +38,5 @@ $giteaResponse = curl_exec($curlConnection); curl_close($curlConnection); - echo $issueData . "\n\n"; - echo $giteaResponse; + echo "Response: " . $giteaResponse; ?>