UNPKG

masto

Version:

Mastodon API client for JavaScript, TypeScript, Node.js, browsers

47 lines (46 loc) 1.19 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.BaseHttp = void 0; class BaseHttp { get(path, data, meta = {}) { return this.request({ method: "GET", path, search: data, ...meta, }).then((response) => response.data); } post(path, data, meta = {}) { return this.request({ method: "POST", path, body: data, ...meta, }).then((response) => response.data); } delete(path, data, meta = {}) { return this.request({ method: "DELETE", path, body: data, ...meta, }).then((response) => response.data); } put(path, data, meta = {}) { return this.request({ method: "PUT", path, body: data, ...meta, }).then((response) => response.data); } patch(path, data, meta = {}) { return this.request({ method: "PATCH", path, body: data, ...meta, }).then((response) => response.data); } } exports.BaseHttp = BaseHttp;