|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--PTHTTPResponse
Object wrapper for HTTP response received from GET or POST operations. The
callback method invoked by the transport mechanism will pass as its one and only
argument a PTHTTPResponse object -- there should be no public need to construct one
explicitly. Response handling functions can then access the properties of the PTHTTPResponse
in the course of processing the HTTP request/response. PTHTTPResponses should never be
instantiated directly but should be generated by the PTHTTPTransport in response to a PTHTTPRequest.
Usage:
function handleResponseAlert(response)
{
var text = 'Response Message:\n';
var text += response.responseText;
if(response.type == PTHTTPResponse.RESPONSE_TYPE_OK)
alert(text);
}
Field Summary | |
<private> Object |
_responseHeaders
|
<private> Object |
_responseHeadersString
|
<private> Object |
className
|
<private> Object |
hasPTResponseType
|
PTHTTPRequest |
request
The PTHTTPRequest object that generated this response. |
String |
responseText
The response content text returned by the PTHTTPResponse. |
XML Document |
responseXML
The response content xml returned by the PTHTTPResponse. |
Number |
status
Status code of the respone |
String |
type
Response type, typically one of the response type constants. |
<static> <final> String |
PT_LOGIN_URL_HEADER
PT login URL header -- used with session timeout respose type |
<static> <final> String |
PT_RESPONSE_TYPE_HEADER
name of the response type header |
<static> <final> String |
PT_RESPONSE_TYPE_HEADER_SAFARI
name of the response type header for Safari browsers, since Safari seems to change the case on custom headers. |
<static> <final> String |
PT_RESPONSE_TYPE_PORTLET_ERROR
header for portlet errors |
<static> <final> String |
PT_RESPONSE_TYPE_PORTLET_TIMEOUT
header for portlet timeouts |
<static> <final> String |
PT_RESPONSE_TYPE_SESSION_TIMEOUT
header for session timeouts |
<static> <final> String |
RESPONSE_TYPE_EMPTY_RESPONSE
Response Type SERVER_ERROR (Response Code 204 [1223]) |
<static> <final> String |
RESPONSE_TYPE_NO_RESPONSE
no response from the server at all |
<static> <final> String |
RESPONSE_TYPE_OK
Response Type OK (Response Code 200) |
<static> <final> String |
RESPONSE_TYPE_PORTLET_ERROR
represents an error in the remote tier or gateway. |
<static> <final> String |
RESPONSE_TYPE_PORTLET_TIMEOUT
represents a portlet timed out by the gateway. |
<static> <final> String |
RESPONSE_TYPE_REDIRECT
Response Type REDIRECT (Response Code 302) |
<static> <final> String |
RESPONSE_TYPE_SERVER_ERROR
Response Type SERVER_ERROR (Response Code 400-599) |
<static> <final> String |
RESPONSE_TYPE_SESSION_EXPIRED
Response Type SESSION_EXPIRED (Response Code 200), with portal login page. |
<static> <final> Object |
VERSION
|
Constructor Summary | |
PTHTTPResponse
(request, responseText, responseXML, status, type, responseHeadersString)
Wrapper for HTTP responses recieved from GET or POST requests. |
Method Summary | |
<private> Object
|
_getResponseTypeFromHeaders(status)
Gets the response type from the http response header |
Hash
|
getResponseHeaders()
getResponseHeaders Returns an associate array (object) of response header name/value pairs |
<static> Boolean
|
isValid(HTTPResponse)
isValid Returns whether or not a response appears to be valid |
Field Detail |
<private> Object _responseHeaders
<private> Object _responseHeadersString
<private> Object className
<private> Object hasPTResponseType
PTHTTPRequest request
String responseText
XML Document responseXML
Number status
String type
<static> <final> String PT_LOGIN_URL_HEADER
<static> <final> String PT_RESPONSE_TYPE_HEADER
<static> <final> String PT_RESPONSE_TYPE_HEADER_SAFARI
<static> <final> String PT_RESPONSE_TYPE_PORTLET_ERROR
<static> <final> String PT_RESPONSE_TYPE_PORTLET_TIMEOUT
<static> <final> String PT_RESPONSE_TYPE_SESSION_TIMEOUT
<static> <final> String RESPONSE_TYPE_EMPTY_RESPONSE
<static> <final> String RESPONSE_TYPE_NO_RESPONSE
<static> <final> String RESPONSE_TYPE_OK
<static> <final> String RESPONSE_TYPE_PORTLET_ERROR
<static> <final> String RESPONSE_TYPE_PORTLET_TIMEOUT
<static> <final> String RESPONSE_TYPE_REDIRECT
<static> <final> String RESPONSE_TYPE_SERVER_ERROR
<static> <final> String RESPONSE_TYPE_SESSION_EXPIRED
<static> <final> Object VERSION
Constructor Detail |
PTHTTPResponse(request, responseText, responseXML, status, type, responseHeadersString)
request
- Reference to the calling request object(PTHTTPGETRequest or PTHTTPPOSTRequest)
responseText
- The raw text returned by the request
responseXML
- The XML returned by the request
status
- Status of the response
type
- Type of response
Method Detail |
<private> Object _getResponseTypeFromHeaders(status)
Hash getResponseHeaders()
<static> Boolean isValid(HTTPResponse)
HTTPResponse
- HTTP Response object (PTHTTPResponse object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |