MCPcopy Create free account
hub / github.com/Azure/powershell / getJson

Method getJson

lib/index.js:2669–2675  ·  view source on GitHub ↗

* Gets a typed object from an endpoint * Be aware that not found returns a null. Other errors (4xx, 5xx) reject the promise

(requestUrl, additionalHeaders = {})

Source from the content-addressed store, hash-verified

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);

Callers 2

getManifestFromRepoFunction · 0.95
getCallMethod · 0.80

Calls 3

getMethod · 0.95
_processResponseMethod · 0.95

Tested by

no test coverage detected