Class glow.net.XhrResponse
Extends
glow.events.Event.
Defined in: core.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
The event object for glow.net.XhrRequest's 'load' & 'error' events.
|
| Field Attributes | Field Name and Description |
|---|---|
|
The response object from the browser.
|
|
|
HTTP status code of the response
|
|
|
Boolean indicating if the request returned successfully.
|
|
|
Boolean indicating if the requests time out was reached.
|
- Fields borrowed from class glow.events.Event:
- attachedTo
| Method Attributes | Method Name and Description |
|---|---|
|
header(name)
Gets a header from the response.
|
|
|
json(safeMode)
Gets the body of the response as a JSON object.
|
|
|
nodeList()
Gets the body of the response as a glow.NodeList.
|
|
|
Gets the meaning of {@link glow.net.XhrResponse#status status}.
|
|
|
text()
Gets the body of the response as plain text
|
|
|
xml()
Gets the body of the response as xml
|
- Methods borrowed from class glow.events.Event:
- defaultPrevented, preventDefault
Class Detail
glow.net.XhrResponse()
The event object for glow.net.XhrRequest's 'load' & 'error' events.
Field Detail
{XMLHttpRequest}
nativeResponse
The response object from the browser.
This may not have the same properties and methods across user agents.
{number}
status
HTTP status code of the response
{boolean}
successful
Boolean indicating if the request returned successfully.
{boolean}
timedOut
Boolean indicating if the requests time out was reached.
Method Detail
{string}
header(name)
Gets a header from the response.
var contentType = myResponse.header("Content-Type");
- Parameters:
- {string} name
- Header name
- Returns:
- {string} Header value
{object}
json(safeMode)
Gets the body of the response as a JSON object.
- Parameters:
- {boolean} safeMode Optional, Default: false
- If true, the response will be parsed using a string parser which will filter out non-JSON javascript, this will be slower but recommended if you do not trust the data source.
- Returns:
- {object}
{glow.NodeList}
nodeList()
Gets the body of the response as a glow.NodeList.
- Returns:
- {glow.NodeList}
{string}
statusText()
Gets the meaning of {@link glow.net.XhrResponse#status status}.
- Returns:
- {string}
{string}
text()
Gets the body of the response as plain text
- Returns:
- {string}
{XML}
xml()
Gets the body of the response as xml
- Returns:
- {XML}