phpCAS  version 1.4.0
Public Member Functions | List of all members
CAS_Request_RequestInterface Class Reference
Inheritance diagram for CAS_Request_RequestInterface:
CAS_Request_AbstractRequest CAS_Request_CurlRequest CAS_Request_CurlRequest

Public Member Functions

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

Detailed Description

This interface defines a class library for performing web requests.

Definition at line 40 of file RequestInterface.php.

Member Function Documentation

◆ addCookie()

CAS_Request_RequestInterface::addCookie (   $name,
  $value 
)

Add a cookie to the request.

Parameters
string$namename of cookie
string$valuevalue of cookie
Returns
void
Exceptions
CAS_OutOfSequenceExceptionIf called after the Request has been sent.

◆ addCookies()

CAS_Request_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$cookiescookies to add
Returns
void
Exceptions
CAS_OutOfSequenceExceptionIf called after the Request has been sent.

◆ addHeader()

CAS_Request_RequestInterface::addHeader (   $header)

Add a header string to the request.

Parameters
string$headerheader to add
Returns
void
Exceptions
CAS_OutOfSequenceExceptionIf called after the Request has been sent.

Referenced by CAS_ProxiedService_Http_Post\populateRequest().

◆ addHeaders()

CAS_Request_RequestInterface::addHeaders ( array  $headers)

Add an array of header strings to the request.

Parameters
array$headersheaders to add
Returns
void
Exceptions
CAS_OutOfSequenceExceptionIf called after the Request has been sent.

◆ getErrorMessage()

CAS_Request_RequestInterface::getErrorMessage ( )

Answer a message describing any errors if the request failed.

Returns
string
Exceptions
CAS_OutOfSequenceExceptionIf called before the Request has been sent.

◆ getResponseBody()

CAS_Request_RequestInterface::getResponseBody ( )

Answer the body of response.

Returns
string
Exceptions
CAS_OutOfSequenceExceptionIf called before the Request has been sent.

◆ getResponseHeaders()

CAS_Request_RequestInterface::getResponseHeaders ( )

Answer the headers of the response.

Returns
array An array of header strings.
Exceptions
CAS_OutOfSequenceExceptionIf called before the Request has been sent.

◆ getResponseStatusCode()

CAS_Request_RequestInterface::getResponseStatusCode ( )

Answer HTTP status code of the response

Returns
int
Exceptions
CAS_OutOfSequenceExceptionIf called before the Request has been sent.

◆ makePost()

CAS_Request_RequestInterface::makePost ( )

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

Returns
void
Exceptions
CAS_OutOfSequenceExceptionIf called after the Request has been sent.

Referenced by CAS_ProxiedService_Http_Post\populateRequest().

◆ send()

CAS_Request_RequestInterface::send ( )

Perform the request.

Returns
bool TRUE on success, FALSE on failure.
Exceptions
CAS_OutOfSequenceExceptionIf called multiple times.

◆ setPostBody()

CAS_Request_RequestInterface::setPostBody (   $body)

Add a POST body to the request

Parameters
string$bodybody to add
Returns
void
Exceptions
CAS_OutOfSequenceExceptionIf called after the Request has been sent.

Referenced by CAS_ProxiedService_Http_Post\populateRequest().

◆ setSslCaCert()

CAS_Request_RequestInterface::setSslCaCert (   $caCertPath,
  $validate_cn = true 
)

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

Parameters
string$caCertPathpath to cert file
boolean$validate_cnvalidate CN of SSL certificate
Returns
void
Exceptions
CAS_OutOfSequenceExceptionIf called after the Request has been sent.

◆ setUrl()

CAS_Request_RequestInterface::setUrl (   $url)

Set the URL of the Request

Parameters
string$urlurl to set
Returns
void
Exceptions
CAS_OutOfSequenceExceptionIf called after the Request has been sent.