mphttpx 1.0.7 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -28,11 +28,11 @@ This allows web code to be reused in other environments (such as mini-programs).
28
28
  - [Compatibility](#compatibility-6)
29
29
  - [fetch](#fetch)
30
30
  - [Compatibility](#compatibility-7)
31
- - [Headers](#headers)
32
- - [Compatibility](#compatibility-8)
33
31
  - [Request](#request)
34
- - [Compatibility](#compatibility-9)
32
+ - [Compatibility](#compatibility-8)
35
33
  - [Response](#response)
34
+ - [Compatibility](#compatibility-9)
35
+ - [Headers](#headers)
36
36
  - [Compatibility](#compatibility-10)
37
37
  - [AbortController](#abortcontroller)
38
38
  - [Compatibility](#compatibility-11)
@@ -376,48 +376,6 @@ fetch("https://example.com/profile/avatar", {
376
376
 
377
377
  Refer to Request below.
378
378
 
379
- ### Headers
380
-
381
- ```javascript
382
- import { Headers } from "mphttpx";
383
-
384
- const myHeaders = new Headers();
385
-
386
- myHeaders.append("Content-Type", "text/plain");
387
- myHeaders.get("Content-Type"); // should return 'text/plain'
388
- ```
389
-
390
- The same can be achieved by passing an array of arrays or an object literal to the constructor:
391
-
392
- ```javascript
393
- import { Headers } from "mphttpx";
394
-
395
- let myHeaders = new Headers({
396
- "Content-Type": "text/plain",
397
- });
398
-
399
- // or, using an array of arrays:
400
- myHeaders = new Headers([["Content-Type", "text/plain"]]);
401
-
402
- myHeaders.get("Content-Type"); // should return 'text/plain'
403
- ```
404
-
405
- #### Compatibility
406
-
407
- | Method | Available | Description |
408
- | ------- | --------- | -------------|
409
- | append(name, value) | ✔ |
410
- | delete(name) | ✔ |
411
- | entries() | ✔ |
412
- | forEach(callbackFn) | ✔ |
413
- | forEach(callbackFn, thisArg) | ✔ |
414
- | get(name) | ✔ |
415
- | getSetCookie() | ✔ |
416
- | has(name) | ✔ |
417
- | keys() | ✔ |
418
- | set(name, value) | ✔ |
419
- | values() | ✔ |
420
-
421
379
  ### Request
422
380
 
423
381
  ```javascript
@@ -530,6 +488,48 @@ const myResponse = new Response(myBlob, myOptions);
530
488
  | json() | ✔ |
531
489
  | text() | ✔ |
532
490
 
491
+ ### Headers
492
+
493
+ ```javascript
494
+ import { Headers } from "mphttpx";
495
+
496
+ const myHeaders = new Headers();
497
+
498
+ myHeaders.append("Content-Type", "text/plain");
499
+ myHeaders.get("Content-Type"); // should return 'text/plain'
500
+ ```
501
+
502
+ The same can be achieved by passing an array of arrays or an object literal to the constructor:
503
+
504
+ ```javascript
505
+ import { Headers } from "mphttpx";
506
+
507
+ let myHeaders = new Headers({
508
+ "Content-Type": "text/plain",
509
+ });
510
+
511
+ // or, using an array of arrays:
512
+ myHeaders = new Headers([["Content-Type", "text/plain"]]);
513
+
514
+ myHeaders.get("Content-Type"); // should return 'text/plain'
515
+ ```
516
+
517
+ #### Compatibility
518
+
519
+ | Method | Available | Description |
520
+ | ------- | --------- | -------------|
521
+ | append(name, value) | ✔ |
522
+ | delete(name) | ✔ |
523
+ | entries() | ✔ |
524
+ | forEach(callbackFn) | ✔ |
525
+ | forEach(callbackFn, thisArg) | ✔ |
526
+ | get(name) | ✔ |
527
+ | getSetCookie() | ✔ |
528
+ | has(name) | ✔ |
529
+ | keys() | ✔ |
530
+ | set(name, value) | ✔ |
531
+ | values() | ✔ |
532
+
533
533
  ### AbortController
534
534
 
535
535
  ```javascript