ngx-restful-client
Version:
The ultimate Angular library to exquisitely declare and implement the REST APIs you'll use in your application.
45 lines (44 loc) • 1.62 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var defaultCfgOpts = function (options) { return options; };
/**
* Agrega os tipos de retornos disponíveis para cada método HTTP: GET, PUT, POST,PATCH, DELETE
*
* - JSON;
* - BLOB;
* - ARRAYBUFFER;
* - TEXT.
*
* com a possibilidade de escolher o que será observado:
* - BODY;
* - EVENTS;
* - RESPONSE.
*
*/
var HttpMethodResponse = /** @class */ (function () {
function HttpMethodResponse(dispatcher, configOpts) {
if (configOpts === void 0) { configOpts = defaultCfgOpts; }
this.dispatcher = dispatcher;
this.configOpts = configOpts;
}
HttpMethodResponse.prototype.get = function (options) {
return this.dispatcher.httpGet('', this.configOpts(options));
};
HttpMethodResponse.prototype.put = function (body, options) {
if (body === void 0) { body = null; }
return this.dispatcher.httpPut('', body, this.configOpts(options));
};
HttpMethodResponse.prototype.post = function (body, options) {
if (body === void 0) { body = null; }
return this.dispatcher.httpPost('', body, this.configOpts(options));
};
HttpMethodResponse.prototype.patch = function (body, options) {
if (body === void 0) { body = null; }
return this.dispatcher.httpPatch('', body, this.configOpts(options));
};
HttpMethodResponse.prototype.delete = function (options) {
return this.dispatcher.httpDelete('', this.configOpts(options));
};
return HttpMethodResponse;
}());
exports.HttpMethodResponse = HttpMethodResponse;