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; ?>