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

Method postJson

lib/index.js:2676–2684  ·  view source on GitHub ↗
(requestUrl, obj, additionalHeaders = {})

Source from the content-addressed store, hash-verified

2674 });
2675 }
2676 postJson(requestUrl, obj, additionalHeaders = {}) {
2677 return __awaiter(this, void 0, void 0, function* () {
2678 const data = JSON.stringify(obj, null, 2);
2679 additionalHeaders[Headers.Accept] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.Accept, MediaTypes.ApplicationJson);
2680 additionalHeaders[Headers.ContentType] = this._getExistingOrDefaultHeader(additionalHeaders, Headers.ContentType, MediaTypes.ApplicationJson);
2681 const res = yield this.post(requestUrl, data, additionalHeaders);
2682 return this._processResponse(res, this.requestOptions);
2683 });
2684 }
2685 putJson(requestUrl, obj, additionalHeaders = {}) {
2686 return __awaiter(this, void 0, void 0, function* () {
2687 const data = JSON.stringify(obj, null, 2);

Callers

nothing calls this directly

Calls 4

postMethod · 0.95
_processResponseMethod · 0.95
stringifyMethod · 0.80

Tested by

no test coverage detected