* Gets a typed object from an endpoint * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise
(requestUrl, additionalHeaders = {})
| 2667 | * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise |
| 2668 | */ |
| 2669 | getJson(requestUrl, additionalHeaders = {}) { |
| 2670 | return __awaiter(this, void 0, void 0, function* () { |
| 2671 | additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson); |
| 2672 | const res = yield this.get(requestUrl, additionalHeaders); |
| 2673 | return this._processResponse(res, this.requestOptions); |
| 2674 | }); |
| 2675 | } |
| 2676 | postJson(requestUrl, obj, additionalHeaders = {}) { |
| 2677 | return __awaiter(this, void 0, void 0, function* () { |
| 2678 | const data = JSON.stringify(obj, null, 2); |
no test coverage detected