ngx-restful-client
Version:
The ultimate Angular library to exquisitely declare and implement the REST APIs you'll use in your application.
29 lines (28 loc) • 1.12 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
/**
* As implementações dos métodos GET, PUT, POST, DELETE e PATCH devem ser capazes de resolver os tipos de resposta -
* <strong>responseType</strong> e o que observar - <strong>observe</strong>.
*
* Como a maioria de chamadas à APIs trabalham intensamente com JSON, a implementação do
* JsonResponseObserve já é acessível por padrão a partir dos métodos:
*
* - submit(): observa o corpo retornado na requisição;
* - observeEvents(): observa os eventos que ocorrem ao se inscrever no Observable;
* - observeResponse(): observa o corpo da resposta dentre os eventos ocorridos no Observable.
*
*/
var HttpMethod = /** @class */ (function () {
function HttpMethod(http, _json) {
this.http = http;
this._json = _json;
if (http === null || http === undefined) {
throw Error("You need the HttpClient, please provide one!");
}
}
HttpMethod.prototype.json = function () {
return this._json;
};
return HttpMethod;
}());
exports.HttpMethod = HttpMethod;