aboutsummaryrefslogtreecommitdiff
path: root/src/z/rest.js
blob: c14944dc2607d2f1fac17261c2a5e997f59e0f0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const Rest = {
	Request: class {
		constructor(base) {
			this.base = base;
		}

		get(url) { return fetch(url); }

		post(url, body) {
			return fetch(
				url,
				{
					method: 'POST',
					body: JSON.stringify(body),
				}
			);
		}
	},
};