xhr.js
No description.

File Location

/goog/labs/net/xhr.js

Classes

goog.labs.net.xhr.Error
Generic error that may occur during a request.
goog.labs.net.xhr.HttpError
Class for HTTP errors.
goog.labs.net.xhr.TimeoutError
Class for Timeout errors.

Public Protected Private

Global Functions

goog.labs.net.xhr.get(urlopt_options) !goog.Promise.<string>
Sends a get request, returning a promise that will be resolved with the response text once the request completes.
Arguments:
url : string
The URL to request.
opt_options : _.Options=
Configuration options for the request.
Returns: !goog.Promise.<string>  A promise that will be resolved with the response text once the request completes.
code »
goog.labs.net.xhr.getJson(urlopt_options) !goog.Promise.<Object>
Sends a get request, returning a promise that will be resolved with the parsed response text once the request completes.
Arguments:
url : string
The URL to request.
opt_options : _.Options=
Configuration options for the request.
Returns: !goog.Promise.<Object>  A promise that will be resolved with the response JSON once the request completes.
code »
goog.labs.net.xhr.isEffectiveSchemeHttp_(url) boolean
No description.
Arguments:
url : string
The URL to test.
Returns: boolean  Whether the effective scheme is HTTP or HTTPs.
code »
goog.labs.net.xhr.send&function%0&xhr.onerror()
No description.
code »
goog.labs.net.xhr.parseJson_(responseTextoptions) Object
JSON-parses the given response text, returning an Object.
Arguments:
responseText : string
Response text.
options : _.Options | undefined
The options object.
Returns: Object  The JSON-parsed value of the original responseText.
code »
goog.labs.net.xhr.post(urldataopt_options) !goog.Promise.<string>
Sends a post request, returning a promise that will be resolved with the response text once the request completes.
Arguments:
url : string
The URL to request.
data : _.PostData
The body of the post request.
opt_options : _.Options=
Configuration options for the request.
Returns: !goog.Promise.<string>  A promise that will be resolved with the response text once the request completes.
code »
goog.labs.net.xhr.postJson(urldataopt_options) !goog.Promise.<Object>
Sends a post request, returning a promise that will be resolved with the parsed response text once the request completes.
Arguments:
url : string
The URL to request.
data : _.PostData
The body of the post request.
opt_options : _.Options=
Configuration options for the request.
Returns: !goog.Promise.<Object>  A promise that will be resolved with the response JSON once the request completes.
code »
goog.labs.net.xhr.send(methodurldataopt_options) !goog.Promise.<!goog.net.XhrLike.OrNative>
Sends a request, returning a promise that will be resolved with the XHR object once the request completes.
Arguments:
method : string
The HTTP method for the request.
url : string
The URL to request.
data : _.PostData
The body of the post request.
opt_options : _.Options=
Configuration options for the request.
Returns: !goog.Promise.<!goog.net.XhrLike.OrNative>  A promise that will be resolved with the XHR object once the request completes.
code »
goog.labs.net.xhr.stripXssiPrefix_(prefixstring) string
Strips the XSSI prefix from the input string.
Arguments:
prefix : string
The XSSI prefix.
string : string
The string to strip the prefix from.
Returns: string  The input string without the prefix.
code »

Directory net

File Reference