The goog.net.XhrManager.Request Class

goog.net.XhrManager.Request
> goog.Disposable

goog.net.XhrManager.Request(url, xhrEventCallback, opt_method, opt_content, opt_headers, opt_callback, opt_maxRetries)

An encapsulation of everything needed to make a Xhr request. NOTE: This is used internal to the XhrManager.

url {string}
Uri to make the request too.
xhrEventCallback {Function}
Callback attached to the events of the XhrIo object of the request.
opt_method {string=}
Send method, default: GET.
opt_content {string=}
Post data.
opt_headers {Object|goog.structs.Map=}
Map of headers to add to the request.
opt_callback {Function=}
Callback function for when request is complete. NOTE: Only 1 callback supported across all events.
opt_maxRetries {number=}
The maximum number of times the request should be retried (Default: 1).

.addOnDisposeCallback(callback, opt_scope)

Inherited from goog.Disposable .

Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.

callback {!Function}
The callback function.
opt_scope {Object=}
An optional scope to call the callback in.

.creationStack {string}

Inherited from goog.Disposable .

If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.

.dispose()

Inherited from goog.Disposable .

Disposes of the object. If the object hasn't already been disposed of, calls {@link #disposeInternal}. Classes that extend {@code goog.Disposable} should override {@link #disposeInternal} in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.

returns {void}
Nothing.

.getAborted()

Gets the aborted status.

returns {boolean}
True if request was aborted, otherwise False.

.getAttemptCount()

Gets the number of attempts so far.

returns {number}
The number of attempts so far.

.getCompleteCallback()

Gets the callback for when the request is complete.

returns {Function|undefined}
The callback for when the request is complete.

.getCompleted()

Gets the completed status.

returns {boolean}
The completed status.

.getContent()

Gets the post data.

returns {string|undefined}
The post data.

.getHeaders()

Gets the map of headers.

returns {Object|goog.structs.Map}
The map of headers.

.getMaxRetries()

Gets the maximum number of times the request should be retried.

returns {number}
The maximum number of times the request should be retried.

.getMethod()

Gets the send method.

returns {string}
The send method.

.getUrl()

Gets the uri.

returns {string}
The uri to make the request to.

.getXhrEventCallback()

Gets the callback attached to the events of the XhrIo object.

returns {Function|undefined}
The callback attached to the events of the XhrIo object.

.hasReachedMaxRetries()

Returns whether the request has reached the maximum number of retries.

returns {boolean}
Whether the request has reached the maximum number of retries.

.increaseAttemptCount()

Increases the number of attempts so far.

.isDisposed()

Inherited from goog.Disposable .

returns {boolean}
Whether the object has been disposed of.

.registerDisposable(disposable)

Inherited from goog.Disposable .

Associates a disposable object with this object so that they will be disposed together.

disposable {goog.disposable.IDisposable}
that will be disposed when this object is disposed.

.setAborted(aborted)

Sets the aborted status.

aborted {boolean}
True if the request was aborted, otherwise False.

.setCompleted(complete)

Sets the completed status.

complete {boolean}
The completed status.

.xhrIo {goog.net.XhrIo}

The XhrIo instance handling this request. Set in handleAvailableXhr.