Files
pushstream-socketio/public/test.php
T
2026-06-11 13:11:39 +02:00

15 lines
494 B
PHP

<?php
$ch = curl_init('http://push:8080/pub/channel');
# Setup request to send json via POST.
$payload = json_encode( array( "customer"=> $argv[1]) );
curl_setopt( $ch, CURLOPT_POSTFIELDS, $payload );
curl_setopt( $ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json'));
# Return response instead of printing.
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
# Send request.
$result = curl_exec($ch);
var_export($result);
curl_close($ch);
# Print response.
echo "<pre>$result</pre>";