Options
All
  • Public
  • Public/Protected
  • All
Menu

Extended version of XMLHttpRequest with support for customizations (headers, ...)

Hierarchy

  • WebRequest

Implements

Index

Constructors

Properties

CustomRequestHeaders: {}

Custom HTTP Request Headers to be sent with XMLHttpRequests i.e. when loading files, where the server/service expects an Authorization header

Type declaration

  • [key: string]: string
CustomRequestModifiers: ((request: XMLHttpRequest, url: string) => void)[]

Add callback functions in this array to update all the requests before they get sent to the network

SkipRequestModificationForBabylonCDN: boolean

Accessors

  • get onprogress(): null | ((this: XMLHttpRequest, ev: ProgressEvent<EventTarget>) => any)
  • set onprogress(value: null | ((this: XMLHttpRequest, ev: ProgressEvent<EventTarget>) => any)): void
  • Gets or sets a function to be called when loading progress changes

    Returns null | ((this: XMLHttpRequest, ev: ProgressEvent<EventTarget>) => any)

  • Gets or sets a function to be called when loading progress changes

    Parameters

    • value: null | ((this: XMLHttpRequest, ev: ProgressEvent<EventTarget>) => any)

    Returns void

  • get readyState(): number
  • Returns client's state

    Returns number

  • get response(): any
  • Returns client's response

    Returns any

  • get responseText(): string
  • Returns client's response as text

    Returns string

  • get responseType(): XMLHttpRequestResponseType
  • set responseType(value: XMLHttpRequestResponseType): void
  • Gets or sets the expected response type

    Returns XMLHttpRequestResponseType

  • Gets or sets the expected response type

    Parameters

    • value: XMLHttpRequestResponseType

    Returns void

  • get responseURL(): string
  • Returns client's response url

    Returns string

  • get status(): number
  • Returns client's status

    Returns number

  • get statusText(): string
  • Returns client's status as a text

    Returns string

  • get timeout(): number
  • set timeout(value: number): void
  • Gets or sets the timeout value in milliseconds

    Returns number

  • Gets or sets the timeout value in milliseconds

    Parameters

    • value: number

    Returns void

  • get IsCustomRequestAvailable(): boolean
  • This function can be called to check if there are request modifiers for network requests

    Returns boolean

    true if there are any custom requests available

Methods

  • abort(): void
  • Cancels any network activity

    Returns void

  • getResponseHeader(name: string): Nullable<string>
  • Get the string containing the text of a particular header's value.

    Parameters

    • name: string

      The name of the header

    Returns Nullable<string>

    The string containing the text of the given header name

  • open(method: string, url: string): void
  • Sets the request method, request URL

    Parameters

    • method: string

      defines the method to use (GET, POST, etc..)

    • url: string

      defines the url to connect with

    Returns void

  • send(body?: null | Document | XMLHttpRequestBodyInit): void
  • Initiates the request. The optional argument provides the request body. The argument is ignored if request method is GET or HEAD

    Parameters

    • Optional body: null | Document | XMLHttpRequestBodyInit

      defines an optional request body

    Returns void

  • setRequestHeader(name: string, value: string): void
  • Sets the value of a request header.

    Parameters

    • name: string

      The name of the header whose value is to be set

    • value: string

      The value to set as the body of the header

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Property
  • Method
  • Static property
  • Static method

Settings

Theme