You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How you send the PushSubscription data to your backend, store it
@@ -60,19 +63,19 @@ in the `subscription_info` block.
60
63
61
64
**Parameters**
62
65
63
-
*subscription_info* - The `dict` of the subscription info (described above).
66
+
_subscription_info_ - The `dict` of the subscription info (described above).
64
67
65
-
*data* - can be any serial content (string, bit array, serialized JSON, etc), but be sure that your receiving
68
+
_data_ - can be any serial content (string, bit array, serialized JSON, etc), but be sure that your receiving
66
69
application is able to parse and understand it. (e.g. `data = "Mary had a little lamb."`)
67
70
68
-
*content_type* - specifies the form of Encryption to use, either `'aes128gcm'` or the deprecated `'aesgcm'`. NOTE that
71
+
_content_type_ - specifies the form of Encryption to use, either `'aes128gcm'` or the deprecated `'aesgcm'`. NOTE that
69
72
not all User Agents can decrypt `'aesgcm'`, so the library defaults to the RFC 8188 standard form.
70
73
71
-
*vapid_claims* - a `dict` containing the VAPID claims required for authorization (See
74
+
_vapid_claims_ - a `dict` containing the VAPID claims required for authorization (See
72
75
[py_vapid](https://github.com/web-push-libs/vapid/tree/master/python) for more details). If `aud` is not specified,
73
76
pywebpush will attempt to auto-fill from the `endpoint`.
74
77
75
-
*vapid_private_key* - Either a path to a VAPID EC2 private key PEM file, or a string containing the DER representation.
78
+
_vapid_private_key_ - Either a path to a VAPID EC2 private key PEM file, or a string containing the DER representation.
76
79
(See [py_vapid](https://github.com/web-push-libs/vapid/tree/master/python) for more details.) The `private_key` may be
77
80
a base64 encoded DER formatted private key, or the path to an OpenSSL exported private key file.
78
81
@@ -126,23 +129,23 @@ Send the data using additional parameters. On error, returns a `WebPushException
126
129
127
130
**Parameters**
128
131
129
-
*data* Binary string of data to send
132
+
_data_ Binary string of data to send
130
133
131
-
*headers* A `dict` containing any additional headers to send
134
+
_headers_ A `dict` containing any additional headers to send
132
135
133
-
*ttl* Message Time To Live on Push Server waiting for the client to reconnect (in seconds)
136
+
_ttl_ Message Time To Live on Push Server waiting for the client to reconnect (in seconds)
134
137
135
-
*gcm_key* Google Cloud Messaging key (if using the older GCM push system) This is the API key obtained from the Google
138
+
_gcm_key_ Google Cloud Messaging key (if using the older GCM push system) This is the API key obtained from the Google
136
139
Developer Console.
137
140
138
-
*reg_id* Google Cloud Messaging registration ID (will be extracted from endpoint if not specified)
141
+
_reg_id_ Google Cloud Messaging registration ID (will be extracted from endpoint if not specified)
139
142
140
-
*content_encoding* ECE content encoding type (defaults to "aes128gcm")
143
+
_content_encoding_ ECE content encoding type (defaults to "aes128gcm")
141
144
142
-
*curl* Do not execute the POST, but return as a `curl` command. This will write the encrypted content to a local file
145
+
_curl_ Do not execute the POST, but return as a `curl` command. This will write the encrypted content to a local file
143
146
named `encrpypted.data`. This command is meant to be used for debugging purposes.
144
147
145
-
*timeout* timeout for requests POST query.
148
+
_timeout_ timeout for requests POST query.
146
149
See [requests documentation](http://docs.python-requests.org/en/master/user/quickstart/#timeouts).
147
150
148
151
**Example**
@@ -159,9 +162,9 @@ Encode the `data` for future use. On error, returns a `WebPushException`
159
162
160
163
**Parameters**
161
164
162
-
*data* Binary string of data to send
165
+
_data_ Binary string of data to send
163
166
164
-
*content_encoding* ECE content encoding type (defaults to "aes128gcm")
167
+
_content_encoding_ ECE content encoding type (defaults to "aes128gcm")
165
168
166
169
**Example**
167
170
@@ -175,22 +178,26 @@ If you're not really into coding your own solution, there's also a "stand-alone"
175
178
./bin directory.
176
179
177
180
This uses two files:
178
-
* the *data* file, which contains the message to send, in whatever form you like.
179
-
* the *subscription info* file, which contains the subscription information as JSON encoded data. This is usually returned by the Push `subscribe` method and looks something like:
181
+
182
+
- the _data_ file, which contains the message to send, in whatever form you like.
183
+
- the _subscription info_ file, which contains the subscription information as JSON encoded data. This is usually returned by the Push `subscribe` method and looks something like:
180
184
181
185
```json
182
-
{"endpoint": "https://push...",
183
-
"keys": {
184
-
"auth": "ab01...",
185
-
"p256dh": "aa02..."
186
-
}}
186
+
{
187
+
"endpoint": "https://push...",
188
+
"keys": {
189
+
"auth": "ab01...",
190
+
"p256dh": "aa02..."
191
+
}
192
+
}
187
193
```
188
194
189
195
If you're interested in just testing your applications WebPush interface, you could use the Command Line:
0 commit comments