HEX
Server: Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System: Windows NT ALTAIR 10.0 build 20348 (Windows Server 2022) AMD64
User: Administrator (0)
PHP: 8.1.10
Disabled: NONE
Upload Files
File: C:/laragon/www/newVip/PHPttmCreateNewTicket.php
<?php
include_once 'PHPSpringServer.php';
$token = $_POST["token"];
$oggetto = $_POST["oggetto"];
$organizzazione = $_POST["organizzazione"];
$area = $_POST["area"];
$testo = $_POST["testo"];
$idUtenteApertura = $_POST["idUtenteApertura"];

$postData = array(
  "oggetto" => $oggetto,
  "organizzazione" => $organizzazione,
  "area" => $area,
  "testo" => $testo
);
$jsonData = json_encode($postData);

$curl = curl_init();
$spring = new SpringServer();
curl_setopt_array($curl, array(
  CURLOPT_URL => $spring->getUrl().'/ttm/creaTicket?idUtenteApertura='.$idUtenteApertura,
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_SSL_VERIFYPEER => false,
  CURLOPT_SSL_VERIFYHOST => false ,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => $jsonData,
  CURLOPT_HTTPHEADER => array(
    'Auth: Bearer '.$token,
    'Content-Type: application/json'
  )
));

$response = curl_exec($curl);

$httpcode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
http_response_code($httpcode);
curl_close($curl);
echo $response;
?>