@@ -127,24 +127,21 @@ request()
127
127
.done (onSuccessCallback, onErrorCallback);
128
128
129
129
// passing an object offers options not available otherwise
130
- let json = request ({
130
+ let abort = request ({
131
131
url: new URL (' http://www.example.com' ),
132
132
parameters: new URLSearchParams (' _csrf=TOKEN' ),
133
133
mode: ' cors' ,
134
134
credentials: ' include' ,
135
135
responseType: ' json' ,
136
136
headers: { ' Content-Type' : ' application/json' }
137
- });
138
-
139
- // let's put that base config to good use
140
- let abort = json .get (' /segment' )
141
- .query ({ foo: [' bar' , ' qux' ] })
142
- .hook (' download' , e => { /* … */ })
143
- .done ({
144
- success: onSuccessCallback,
145
- error: onErrorCallback,
146
- abort: onAbortCallback
147
- });
137
+ }).get (' /segment' )
138
+ .query ({ foo: [' bar' , ' qux' ] })
139
+ .hook (' download' , e => { /* … */ })
140
+ .done ({
141
+ success: onSuccessCallback,
142
+ error: onErrorCallback,
143
+ abort: onAbortCallback
144
+ });
148
145
149
146
// forcefully aborts the request
150
147
abort ();
@@ -183,19 +180,19 @@ abort();
183
180
#### HTTP verbs
184
181
185
182
~~~
186
- (Options.url) => Object
183
+ (Options.url? ) => Object
187
184
~~~
188
185
189
186
#### query
190
187
191
188
~~~
192
- (Options.parameters) => Object
189
+ (Options.parameters? ) => Object
193
190
~~~
194
191
195
192
#### send
196
193
197
194
~~~
198
- (Options.body) => Object
195
+ (Options.body? ) => Object
199
196
~~~
200
197
201
198
#### hook
@@ -278,10 +275,10 @@ url | String
278
275
279
276
<sub ><sup >¹ fetch only<br />
280
277
² XHR only<br />
281
- ³ except Firefox 34–43<br />
278
+ ³ except Gecko 34–43<br />
282
279
⁴ MSXML 3.0 only<br />
283
280
⁵ method override<br />
284
- ⁶ fetch, Firefox 16+, Presto/2.10.232–2.12.423<br />
281
+ ⁶ fetch, Gecko 16+, Presto/2.10.232–2.12.423<br />
285
282
⁷ Gecko 1.7β–22</sup ></sub >
286
283
287
284
## Gotchas
@@ -292,7 +289,7 @@ In pre-ES5 environments, the delete method requires the use of the bracket notat
292
289
293
290
### Gecko
294
291
295
- For the browsers powered by Gecko ≤ 20 to have the exposed response headers
292
+ For the browsers powered by Gecko 1.9.1– 20 to have the exposed response headers
296
293
populated into the ` headers ` property, the following conditions must be met:
297
294
298
295
- ` Access-Control-Expose-Headers ` response header exposes itself
@@ -309,7 +306,7 @@ populated into the `headers` property, the following conditions must be met:
309
306
- same scheme restriction
310
307
- the informational and redirection status code classes are considered errors
311
308
- the response's status code and status text are not supplied
312
- - same-origin requests _ also_ requires the server to respond with an ` Access-Control-Allow-Origin ` header of either ` * `
309
+ - same-origin requests _ also_ require the server to respond with an ` Access-Control-Allow-Origin ` header of either ` * `
313
310
or the exact URL of the requesting document
314
311
315
312
#### Platform for Privacy Preferences
0 commit comments