# MyFetch
## How to install
```bash
npm install @madcreativity/temp3
```

## GET
### CommonJS
```js
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+
```html
<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
```js
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+
```html
<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
```js
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+
```html
<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
```js
let myFetch = require("umd.js");

let query = myFetch.init({
    address: "https://reqres.in/api/",
    key: ""
});

query.del("users/2");
```
### ES6+
```html
<script src="umd.js"></script>
<script>
    let query = myFetch.init({
        address: "https://reqres.in/api/",
        key: ""
    });

    query.del("users/2");
</script>
```

## License
ISC