Class PTHTTPResponse

Object
   |
   +--PTHTTPResponse

class 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);
	}
 

Defined in PTHTTPResponse.js


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

_responseHeaders

<private> Object _responseHeaders

_responseHeadersString

<private> Object _responseHeadersString

className

<private> Object className

hasPTResponseType

<private> Object hasPTResponseType

request

PTHTTPRequest request

responseText

String responseText

responseXML

XML Document responseXML

status

Number status

type

String type

PT_LOGIN_URL_HEADER

<static> <final> String PT_LOGIN_URL_HEADER

PT_RESPONSE_TYPE_HEADER

<static> <final> String PT_RESPONSE_TYPE_HEADER

PT_RESPONSE_TYPE_HEADER_SAFARI

<static> <final> String PT_RESPONSE_TYPE_HEADER_SAFARI

PT_RESPONSE_TYPE_PORTLET_ERROR

<static> <final> String PT_RESPONSE_TYPE_PORTLET_ERROR

PT_RESPONSE_TYPE_PORTLET_TIMEOUT

<static> <final> String PT_RESPONSE_TYPE_PORTLET_TIMEOUT

PT_RESPONSE_TYPE_SESSION_TIMEOUT

<static> <final> String PT_RESPONSE_TYPE_SESSION_TIMEOUT

RESPONSE_TYPE_EMPTY_RESPONSE

<static> <final> String RESPONSE_TYPE_EMPTY_RESPONSE

RESPONSE_TYPE_NO_RESPONSE

<static> <final> String RESPONSE_TYPE_NO_RESPONSE

RESPONSE_TYPE_OK

<static> <final> String RESPONSE_TYPE_OK

RESPONSE_TYPE_PORTLET_ERROR

<static> <final> String RESPONSE_TYPE_PORTLET_ERROR

RESPONSE_TYPE_PORTLET_TIMEOUT

<static> <final> String RESPONSE_TYPE_PORTLET_TIMEOUT

RESPONSE_TYPE_REDIRECT

<static> <final> String RESPONSE_TYPE_REDIRECT

RESPONSE_TYPE_SERVER_ERROR

<static> <final> String RESPONSE_TYPE_SERVER_ERROR

RESPONSE_TYPE_SESSION_EXPIRED

<static> <final> String RESPONSE_TYPE_SESSION_EXPIRED

VERSION

<static> <final> Object VERSION

Constructor Detail

PTHTTPResponse

PTHTTPResponse(request, responseText, responseXML, status, type, responseHeadersString)

Method Detail

_getResponseTypeFromHeaders

 <private> Object _getResponseTypeFromHeaders(status)

getResponseHeaders

Hash getResponseHeaders()

isValid

<static> Boolean isValid(HTTPResponse)


Documentation generated by JSDoc on Tue Sep 21 02:04:06 2010