Class WebRequestExecutor

Provides the abstract base class from which network executors derive.

see

{@link http://msdn.microsoft.com/en-us/library/bb397434(v=vs.100).aspx}

Index

Constructor methods

Methods

Constructor methods

constructor(): WebRequestExecutor

Initializes a Sys.Net.WebRequestExecutor instance when implemented in a derived class.

Returns

WebRequestExecutor

Methods

public abort()

Stops the pending network request issued by the executor. The specifics of aborting a request vary depending on how an executor is implemented. However, all executors that derive from WebRequestExecutor must set their state to aborted and must raise the completed event of the associated Sys.Net.WebRequest object. The executor properties do not contain consistent data after abort has been called.

public executeRequest()

Instructs the executor to execute a Web request. When this method is called, the executor packages the content of the Web request instance and initiates processing. This method is intended to be used by a custom executor. If you are implementing a custom executor, you instantiate the executor, assign it to the Web request instance, and then invoke the method on the executor instance.

see

{@link http://msdn.microsoft.com/en-us/library/bb383834(v=vs.100).aspx}

public getAllResponseHeaders(): string

Gets all the response headers for the current request. If a request finished successfully and with valid response data, this method returns all the response headers.

see

{@link http://msdn.microsoft.com/en-us/library/bb310805(v=vs.100).aspx}

Returns

string

All the response headers

public getResponseHeader(): string

Gets the value of the specified response header.

Returns

string

The specified response header.

public get_aborted(): boolean

Gets a value indicating whether the request associated with the executor was aborted. When the current instance of the Sys.Net.WebRequestExecutor class is aborted, it must set its state to aborted and it must raise the completed event of the associated request object.

Returns

boolean

true if the request associated with the executor was aborted; otherwise, false.

public get_responseAvailable(): boolean

Gets a value indicating whether the request completed successfully. Successful completion usually means a well-formed response was received by the executor. If a response was received, the current instance of the Sys.Net.WebRequestExecutor class must set its state to completed. It must also raise the completed event of the associated request object.

Returns

boolean

true if the request completed successfully; otherwise, false.

public get_responseData(): string

Gets the text representation of the response body. When a request has completed successfully with valid response data, this property returns the text that is contained in the response body.

Returns

string

The text representation of the response body.

public get_started(): boolean

Returns a value indicating whether the executor has started processing the request. The executor returns true if substantial processing of the request has started. For executors that make network calls, substantial processing means that a network call has been started.

Returns

boolean

true if the executor has started processing the request; otherwise, false.

public get_statusCode(): number

Gets a success status code. The statusCode property returns an integer that specifies that a request completed successfully and with valid response data.

Returns

number

An integer that represents a status code.

public get_statusText(): string

Gets status information about a request that completed successfully. The statusText property returns status information if a request completed successfully and with valid response data.

Returns

string

the status text

public get_timedOut(): boolean

Gets a value indicating whether the request timed out. Executors use the time-out information associated with the request to raise the completed event on the associated WebRequest object.

Returns

boolean

true if the request timed out; otherwise, false.

public get_webRequest(): WebRequest

Gets the WebRequest object associated with the executor.

Returns

WebRequest

The WebRequest object associated with the current executor instance.

public get_xml(): XMLDocument

Attempts to get the response to the current request as an XMLDOM object. If a request finished successfully with valid response data, this method tries to get the response as an XMLDOM object.

Returns

XMLDocument

public object(): any

Gets the JSON-evaluated object from the response.

Returns

any

The JSON-evaluated response object.