xhrio.js
No description.

File Location

/goog/net/xhrio.js

Classes

goog.net.XhrIo
Basic class for handling XMLHttpRequests.

Public Protected Private

Enumerations

Global Functions

goog.net.XhrIo.cleanup()
Disposes all non-disposed instances of goog.net.XhrIo created by goog.net.XhrIo.send. goog.net.XhrIo.send cleans up the goog.net.XhrIo instance it creates when the request completes or fails. However, if the request never completes, then the goog.net.XhrIo is not disposed. This can occur if the window is unloaded before the request completes. We could have goog.net.XhrIo.send return the goog.net.XhrIo it creates and make the client of goog.net.XhrIo.send be responsible for disposing it in this case. However, this makes things significantly more complicated for the client, and the whole point of goog.net.XhrIo.send is that it's simple and easy to use. Clients of goog.net.XhrIo.send should call goog.net.XhrIo.cleanup when doing final cleanup on window unload.
code »
goog.net.XhrIo.isContentTypeHeader_(header) boolean
No description.
Arguments:
header : string
An HTTP header key.
Returns: boolean  Whether the key is a content type header (ignoring case.
code »
goog.net.XhrIo.protectEntryPoints(errorHandler)
Installs exception protection for all entry point introduced by goog.net.XhrIo instances which are not protected by goog.debug.ErrorHandler#protectWindowSetTimeout, goog.debug.ErrorHandler#protectWindowSetInterval, or goog.events.protectBrowserEventEntryPoint.
Arguments:
errorHandler : goog.debug.ErrorHandler
Error handler with which to protect the entry point(s).
code »
goog.net.XhrIo.send(urlopt_callbackopt_methodopt_contentopt_headersopt_timeoutIntervalopt_withCredentials)
Static send that creates a short lived instance of XhrIo to send the request.
Arguments:
url : string | goog.Uri
Uri to make request to.
opt_callback : Function=
Callback function for when request is complete.
opt_method : string=
Send method, default: GET.
opt_content : ArrayBuffer | ArrayBufferView | Blob | Document | FormData | string=
Body data.
opt_headers : Object | goog.structs.Map=
Map of headers to add to the request.
opt_timeoutInterval : number=
Number of milliseconds after which an incomplete request will be aborted; 0 means no timeout is set.
opt_withCredentials : boolean=
Whether to send credentials with the request. Default to false. See goog.net.XhrIo#setWithCredentials.
code »
goog.net.XhrIo.shouldUseXhr2Timeout_(xhr) boolean
Determines if the argument is an XMLHttpRequest that supports the level 2 timeout value and event. Currently, FF 21.0 OS X has the fields but won't actually call the timeout handler. Perhaps the confusion in the bug referenced below hasn't entirely been resolved.
Arguments:
xhr : !goog.net.XhrLike.OrNative
The request.
Returns: boolean  True if the request supports level 2 timeout.
code »

Global Variables

function%49 :
No description.
Code »

Directory net

File Reference