MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / setRequestHeader

Method setRequestHeader

packages/core/xhr/index.ts:267–275  ·  view source on GitHub ↗
(header: string, value: string)

Source from the content-addressed store, hash-verified

265 }
266
267 public setRequestHeader(header: string, value: string) {
268 if (this._readyState !== this.OPENED || this._sendFlag) {
269 throw new Error("Failed to execute 'setRequestHeader' on 'XMLHttpRequest': " + "The object's state must be OPENED.");
270 }
271
272 if (isString(header) && isString(value)) {
273 this._options.headers[header] = value;
274 }
275 }
276
277 public getAllResponseHeaders(): string {
278 if (this._readyState < 2 || this._errorFlag) {

Calls 1

isStringFunction · 0.90

Tested by

no test coverage detected