import fetch from "node-fetch" export default class WebServiceConnector { public async post(url, payload): Promise { return this.fetch(url, { method: "POST", body: payload, headers: { "Content-type": "application/json", }, }) } public async get(url): Promise { return this.fetch(url, { method: "GET", headers: { "Content-type": "application/json", }, }) } public async put(url, payload): Promise { return this.fetch(url, { method: "PUT", body: payload, headers: { "Content-type": "application/json", }, }) } private async fetch(url, opts): Promise { return fetch(url, opts) } }