Skip to content

Commit 94e58eb

Browse files
alexandre-dauboisdunglas
authored andcommitted
fix: replace file_put_contents() by file_get_contents() in Mercure docs
1 parent bf6e653 commit 94e58eb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs/mercure.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ To subscribe to updates, use the native [`EventSource`](https://developer.mozill
5454

5555
## Publishing Updates
5656

57-
### Using `file_put_contents()`
57+
### Using `file_get_contents()`
5858

5959
To dispatch an update to connected subscribers, send an authenticated POST request to the Mercure hub with the `topic` and `data` parameters:
6060

@@ -64,7 +64,7 @@ To dispatch an update to connected subscribers, send an authenticated POST reque
6464

6565
const JWT = 'eyJhbGciOiJIUzI1NiJ9.eyJtZXJjdXJlIjp7InB1Ymxpc2giOlsiKiJdfX0.PXwpfIGng6KObfZlcOXvcnWCJOWTFLtswGI5DZuWSK4';
6666

67-
$updateID = file_put_contents('https://localhost/.well-known/mercure', context: stream_context_create(['http' => [
67+
$updateID = file_get_contents('https://localhost/.well-known/mercure', context: stream_context_create(['http' => [
6868
'method' => 'POST',
6969
'header' => "Content-type: application/x-www-form-urlencoded\r\nAuthorization: Bearer " . JWT,
7070
'content' => http_build_query([

0 commit comments

Comments
 (0)