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

Inheritance

Constructor

goog.net.XhrManager.Request(urlxhrEventCallbackopt_methodopt_contentopt_headersopt_callbackopt_maxRetriesopt_responseType)

Parameters

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 : ArrayBuffer | ArrayBufferView | Blob | Document | FormData | 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).
opt_responseType : goog.net.XhrIo.ResponseType=
The response type of this request; defaults to goog.net.XhrIo.ResponseType.DEFAULT.

Instance Methods

Public Protected Private
getAborted() boolean
Gets the aborted status.
Returns: boolean  True if request was aborted, otherwise False.
code »
getAttemptCount() number
Gets the number of attempts so far.
Returns: number  The number of attempts so far.
code »
getCompleteCallback() Function | undefined
Gets the callback for when the request is complete.
Returns: Function | undefined  The callback for when the request is complete.
code »
getCompleted() boolean
Gets the completed status.
Returns: boolean  The completed status.
code »
getContent() ArrayBuffer | ArrayBufferView | Blob | Document | FormData | string | undefined
Gets the post data.
Returns: ArrayBuffer | ArrayBufferView | Blob | Document | FormData | string | undefined  The post data.
code »
getHeaders() Object | goog.structs.Map
Gets the map of headers.
Returns: Object | goog.structs.Map  The map of headers.
code »
getMaxRetries() number
Gets the maximum number of times the request should be retried.
Returns: number  The maximum number of times the request should be retried.
code »
getMethod() string
Gets the send method.
Returns: string  The send method.
code »
getResponseType() !goog.net.XhrIo.ResponseType
Gets the response type that will be set on this request's XhrIo when it's available.
Returns: !goog.net.XhrIo.ResponseType  The response type to be set when an XhrIo becomes available to this request.
code »
getUrl() string
Gets the uri.
Returns: string  The uri to make the request to.
code »
getXhrEventCallback() Function
Gets the callback attached to the events of the XhrIo object.
Returns: Function  The callback attached to the events of the XhrIo object.
code »
hasReachedMaxRetries() boolean
Returns whether the request has reached the maximum number of retries.
Returns: boolean  Whether the request has reached the maximum number of retries.
code »
increaseAttemptCount()
Increases the number of attempts so far.
code »
setAborted(aborted)
Sets the aborted status.
Arguments:
aborted : boolean
True if the request was aborted, otherwise False.
code »
setCompleted(complete)
Sets the completed status.
Arguments:
complete : boolean
The completed status.
code »

Instance Properties

aborted_ :
Whether the request has been aborted.
Code »
attemptCount_ :
The number of attempts so far.
Code »
completeCallback_ :
Callback function called when request is complete.
Code »
completed_ :
Whether the request has been completed.
Code »
content_ :
Post data.
Code »
headers_ :
Map of headers
Code »
maxRetries_ :
The maximum number of times the request should be retried.
Code »
method_ :
Send method.
Code »
responseType_ :
A response type to set on this.xhrIo when it's populated.
Code »
url_ :
Uri to make the request too.
Code »
xhrEventCallback_ :
Callback attached to the events of the XhrIo object.
Code »
xhrIo : goog.net.XhrIo
The XhrIo instance handling this request. Set in handleAvailableXhr.
Code »

Package net.XhrManager

Package Reference