lesca-fetcher
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -50,3 +50,3 @@ /** | ||
/** @license MUI v5.7.0 | ||
/** @license MUI v5.11.0 | ||
* | ||
@@ -53,0 +53,0 @@ * This source code is licensed under the MIT license found in the |
{ | ||
"name": "lesca-fetcher", | ||
"version": "1.0.0", | ||
"description": "Integrate fetch for easier use.", | ||
"version": "1.0.1", | ||
"description": "Integrate fetch for easier use", | ||
"main": "lib/index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -9,3 +9,3 @@ [![NPM](https://img.shields.io/badge/NPM-ba443f?style=for-the-badge&logo=npm&logoColor=white)](https://www.npmjs.com/) | ||
## a Module for developer. | ||
Integrate fetch for easier use. | ||
@@ -34,6 +34,7 @@ # Installation | ||
onClick={() => { | ||
const api = '/save'; | ||
const path = '/save'; | ||
const data = { name: 'myName', age: '18' }; | ||
Fetch.post(api, data).then((e) => { | ||
console.log(e); // log result | ||
Fetch.post(path, data).then((respone) => { | ||
// ...script | ||
console.log(respone); | ||
}); | ||
@@ -45,5 +46,6 @@ }} | ||
onClick={() => { | ||
const api = '/get'; | ||
Fetch.get(api).then((e) => { | ||
console.log(e); // log result | ||
const path = '/get'; | ||
Fetch.get(path).then((respone) => { | ||
// ...script | ||
console.log(respone); | ||
}); | ||
@@ -70,4 +72,5 @@ }} | ||
const config = { | ||
hostUrl: 'yourHost', // string | ||
hostUrl: 'https://www.yourHost.com/api/', // string | ||
contentType: contentType.JSON, // enum contentType.JSON || contentType.URL_ENCODED | ||
formatType: formatType.JSON, // enum formatType.JSON || formatType.string | ||
}; | ||
@@ -74,0 +77,0 @@ ``` |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
310852
1620
78