Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
2 contributors

Users who have contributed to this file

@dunglas @soyuka
14 lines (11 sloc) 612 Bytes
<?php
define('DEMO_JWT', 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJtZXJjdXJlIjp7InN1YnNjcmliZSI6WyJmb28iLCJiYXIiXSwicHVibGlzaCI6WyJmb28iXX19.afLx2f2ut3YgNVFStCx95Zm_UND1mZJ69OenXaDuZL8');
$postData = http_build_query([
'topic' => 'http://localhost:3000/demo/books/1.jsonld',
'data' => json_encode(['key' => 'updated value']),
]);
echo file_get_contents('http://localhost:3000/.well-known/mercure', false, stream_context_create(['http' => [
'method' => 'POST',
'header' => "Content-type: application/x-www-form-urlencoded\r\nAuthorization: Bearer ".DEMO_JWT,
'content' => $postData,
]]));
You can’t perform that action at this time.