export class RestController {
    async create(feature, options) {
        let headers = {};
        headers['Content-Type'] = 'application/json';
        if (options.token)
            headers['Authorization'] = 'Bearer ' + options.token;
        return await fetch(options.url, {
            body: JSON.stringify(feature),
            headers: headers,
            method: options.method || 'POST',
            mode: options.mode || 'cors'
        });
    }
    static get is() { return "gl-rest-controller"; }
    static get properties() { return {
        "create": {
            "method": true
        }
    }; }
}
