-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
31 lines (27 loc) · 760 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
const acute = new AcuteFetch();
const url = 'https://jsonplaceholder.typicode.com/posts/';
const urlC = 'https://jsonplaceholder.typicode.com/posts/1';
const data = {
title: 'sunt aut facere repellat provident ',
body: 'quia et suscipit\nsu'
};
const dataUpdate = {
title: 'my new title',
body: 'damn'
};
acute
.get(url)
.then(data => console.log(data))
.catch(err => console.log(`Big Error ${err}`));
acute
.post(url, data)
.then(data => console.log(data))
.catch(err => console.log(`Big Error ${err}`));
acute
.put(urlC, dataUpdate)
.then(data => console.log(data))
.catch(err => console.log(`Big Error ${err}`));
acute
.del(urlC)
.then(() => console.log(`object deleted`))
.catch(err => console.log(`Big error ${err}`));