Skip to content

Commit f0892c1

Browse files
committed
Updated README
1 parent 21955f9 commit f0892c1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,7 @@ $defaultOptions = [
202202
'urgency' => 'normal', // protocol defaults to "normal". (very-low, low, normal, or high)
203203
'topic' => 'newEvent', // not defined by default. Max. 32 characters from the URL or filename-safe Base64 characters sets
204204
'batchSize' => 200, // defaults to 1000
205+
'contentType' => 'application/json', // defaults to "application/octet-stream"
205206
];
206207

207208
// for every notification
@@ -235,6 +236,11 @@ In order to fix this, WebPush sends notifications in batches. The default size i
235236
to decrease this number. Do this while instantiating WebPush or calling `setDefaultOptions`. Or, if you want to customize this for a specific flush, give
236237
it as a parameter : `$webPush->flush($batchSize)`.
237238

239+
#### contentType
240+
241+
Sets the "Content-Type" header for HTTP requests with a non-empty payload sent to the push service.
242+
Especially newer [Declarative push messages](https://www.w3.org/TR/push-api/#declarative-push-message) require a specific JSON payload, so this should be set to "application/json" in such cases.
243+
238244
### Server errors
239245

240246
You can see what the browser vendor's server sends back in case it encountered an error (push subscription expiration, wrong parameters...).

0 commit comments

Comments
 (0)