Public Member Functions

CAS_RequestInterface Interface Reference

Inheritance diagram for CAS_RequestInterface:
CAS_AbstractRequest CAS_CurlRequest CAS_CurlRequest

List of all members.

Public Member Functions

 setUrl ($url)
 addCookie ($name, $value)
 addCookies (array $cookies)
 addHeader ($header)
 addHeaders (array $headers)
 makePost ()
 setPostBody ($body)
 setSslCaCert ($caCertPath)
 send ()
 getResponseHeaders ()
 getResponseStatusCode ()
 getResponseBody ()
 getErrorMessage ()

Detailed Description

This interface defines a class library for performing web requests.

Definition at line 34 of file RequestInterface.php.


Member Function Documentation

CAS_RequestInterface::addCookie ( name,
value 
)

Add a cookie to the request.

Parameters:
string $name
string $value
Returns:
void
Exceptions:
CAS_OutOfSequenceException If called after the Request has been sent.

Implemented in CAS_AbstractRequest.

CAS_RequestInterface::addCookies ( array $  cookies  ) 

Add an array of cookies to the request. The cookie array is of the form array('cookie_name' => 'cookie_value', 'cookie_name2' => cookie_value2')

Parameters:
array $cookies
Returns:
void
Exceptions:
CAS_OutOfSequenceException If called after the Request has been sent.

Implemented in CAS_AbstractRequest.

CAS_RequestInterface::addHeader ( header  ) 

Add a header string to the request.

Parameters:
string $header
Returns:
void
Exceptions:
CAS_OutOfSequenceException If called after the Request has been sent.

Implemented in CAS_AbstractRequest.

Referenced by CAS_ProxiedService_Http_Post::populateRequest().

CAS_RequestInterface::addHeaders ( array $  headers  ) 

Add an array of header strings to the request.

Parameters:
array $headers
Returns:
void
Exceptions:
CAS_OutOfSequenceException If called after the Request has been sent.

Implemented in CAS_AbstractRequest.

CAS_RequestInterface::getErrorMessage (  ) 

Answer a message describing any errors if the request failed.

Returns:
string
Exceptions:
CAS_OutOfSequenceException If called before the Request has been sent.

Implemented in CAS_AbstractRequest.

CAS_RequestInterface::getResponseBody (  ) 

Answer the body of response.

Returns:
string
Exceptions:
CAS_OutOfSequenceException If called before the Request has been sent.

Implemented in CAS_AbstractRequest.

CAS_RequestInterface::getResponseHeaders (  ) 

Answer the headers of the response.

Returns:
array An array of header strings.
Exceptions:
CAS_OutOfSequenceException If called before the Request has been sent.

Implemented in CAS_AbstractRequest.

CAS_RequestInterface::getResponseStatusCode (  ) 

Answer HTTP status code of the response

Returns:
integer
Exceptions:
CAS_OutOfSequenceException If called before the Request has been sent.

Implemented in CAS_AbstractRequest.

CAS_RequestInterface::makePost (  ) 

Make the request a POST request rather than the default GET request.

Returns:
void
Exceptions:
CAS_OutOfSequenceException If called after the Request has been sent.

Implemented in CAS_AbstractRequest.

Referenced by CAS_ProxiedService_Http_Post::populateRequest().

CAS_RequestInterface::send (  ) 

Perform the request.

Returns:
boolean TRUE on success, FALSE on failure.
Exceptions:
CAS_OutOfSequenceException If called multiple times.

Implemented in CAS_AbstractRequest.

CAS_RequestInterface::setPostBody ( body  ) 

Add a POST body to the request

Parameters:
string $body
Returns:
void
Exceptions:
CAS_OutOfSequenceException If called after the Request has been sent.

Implemented in CAS_AbstractRequest.

Referenced by CAS_ProxiedService_Http_Post::populateRequest().

CAS_RequestInterface::setSslCaCert ( caCertPath  ) 

Specify the path to an SSL CA certificate to validate the server with.

Parameters:
string $sslCertPath
Returns:
void
Exceptions:
CAS_OutOfSequenceException If called after the Request has been sent.

Implemented in CAS_AbstractRequest.

CAS_RequestInterface::setUrl ( url  ) 

Set the URL of the Request

Parameters:
string $url
Returns:
void
Exceptions:
CAS_OutOfSequenceException If called after the Request has been sent.

Implemented in CAS_AbstractRequest.