fetch-default
Advanced tools
+1
-1
| { | ||
| "name": "fetch-default", | ||
| "version": "1.0.13", | ||
| "version": "1.0.14", | ||
| "description": "Add global default properties for the web fetch", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
+1
-16
@@ -14,17 +14,2 @@ ## fetch-default | ||
| import 'fetch-default'; | ||
| ### default setting uri prefix | ||
| fetch.default({ | ||
| uriPrefix: '/api' | ||
| }); | ||
| //default request /api/async/get | ||
| fetch('/async/get', { | ||
| method: 'GET' | ||
| }) | ||
| .then((response) => response.json()) | ||
| .then((json) => console.log(json)); | ||
@@ -51,3 +36,3 @@ ### default setting optoin | ||
| fetch('/async/get', { | ||
| method: 'POST'//覆盖默认设置后请求为post(covering) | ||
| method: 'POST'//covering to post | ||
| }) | ||
@@ -54,0 +39,0 @@ .then((response) => response.json()) |
7568
-3.75%125
-10.71%