Class AsyncHTTPRequest

The HTTPRequest class implements an asynchronous HTTP request that is capable of doing both Get and Post.

Hierarchy

  • FrameworkObject
    • AsyncHTTPRequest

Constructors

  • Creates the web request for the specified url. The request is in an idle state until the execute API is invoked.

    Parameters

    Returns AsyncHTTPRequest

Accessors

  • get cacheDurationInSeconds(): number
  • Gets the cache duration in seconds. Must be set before calling execute.

    Returns number

    A request caching is only available if this value is set the first time the URL is requested. Future requests will only used the cached request, if the value is set. The response will only be cached for the duration that was specified when the cache entry was created.

  • set cacheDurationInSeconds(value): void
  • Parameters

    • value: number

    Returns void

  • get errorMessage(): string
  • Gets the error message.

    Returns string

  • get isCached(): boolean
  • Determines if the request was loaded for the cache.

    Returns boolean

  • get isCompleted(): boolean
  • Determines if the response data is available.

    Returns boolean

  • get isFailed(): boolean
  • Determines if the request failed. The failure data is available via errorMessage and statusCode.

    Returns boolean

  • get isInProgress(): boolean
  • Determines if the request is being executed.

    Returns boolean

  • get response(): DataStream
  • Returns the buffer holding the request response. Only valid after the request has completed successfully.

    Returns DataStream

  • get statusCode(): number
  • Gets the status code.

    Returns number

Methods

  • Cancels the web request if it's currently in progress.

    Returns boolean

    true if the web request was cancelled.

  • Gets the header with the name.

    Parameters

    • name: string

    Returns string

  • Removes the header with

    Parameters

    • name: string

    Returns void

  • Sets the header with name to the specified value.

    Parameters

    • name: string
    • value: string

    Returns void