@madcreativity/temp3
v0.1.11
Published
```bash npm install @madcreativity/temp3 ```
Downloads
22
Readme
MyFetch
How to install
npm install @madcreativity/temp3
GET
CommonJS
let myFetch = require("umd.js");
let query = myFetch.init({
address: "https://reqres.in/api/",
key: ""
});
query.get("users?page=2").then(x => console.log(x));
ES6+
<script src="umd.js"></script>
<script>
let query = myFetch.init({
address: "https://reqres.in/api/",
key: ""
});
query.get("users?page=2").then(x => console.log(x));
</script>
POST
CommonJS
let myFetch = require("umd.js");
let query = myFetch.init({
address: "https://reqres.in/api/",
key: ""
});
query.post("users", {
"name": "morpheus",
"job": "zion resident"
}).then(x => console.log(x));
ES6+
<script src="umd.js"></script>
<script>
let query = myFetch.init({
address: "https://reqres.in/api/",
key: ""
});
query.post("users", {
"name": "morpheus",
"job": "zion resident"
}).then(x => console.log(x));
</script>
PUT
CommonJS
let myFetch = require("umd.js");
let query = myFetch.init({
address: "https://reqres.in/api/",
key: ""
});
query.put("users/2", {
"name": "morpheus",
"job": "zion resident"
}).then(x => console.log(x));
ES6+
<script src="umd.js"></script>
<script>
let query = myFetch.init({
address: "https://reqres.in/api/",
key: ""
});
query.put("users/2", {
"name": "morpheus",
"job": "zion resident"
}).then(x => console.log(x));
</script>
DELETE
CommonJS
let myFetch = require("umd.js");
let query = myFetch.init({
address: "https://reqres.in/api/",
key: ""
});
query.del("users/2");
ES6+
<script src="umd.js"></script>
<script>
let query = myFetch.init({
address: "https://reqres.in/api/",
key: ""
});
query.del("users/2");
</script>
License
ISC