In realtà con l'ultimo codice su "TestJson" stai inviando un array e non dovrebbe esistere $_POST['message'] ma i dati POST grezzi su(anche al messaggio precedente avvisavo che non esiste purtroppo)Codice PHP:
$data = file_get_contents('php://input');
CURLOPT_POSTFIELDS:
If value is an array, the Content-Type header will be set to multipart/form-data
converti l'array message (con testo semplice no oggetto json) usando https://www.php.net/manual/en/functi...uild-query.php poi su "PagServer" recuperi la stringa $_POST['message']; e la converti in oggetto json.
Se invece devi inviare un'oggetto json (stringa via POST) anche da "TestJson" leggi nuovamente il $payload, Content-Type e il relativo json_decode del codice proposto al messaggio precedente.