ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
CAS_Request_RequestInterface Class Reference

This interface defines a class library for performing web requests. More...

+ Inheritance diagram for CAS_Request_RequestInterface:
+ Collaboration diagram for CAS_Request_RequestInterface:

Public Member Functions

 setUrl ($url)
 Set the URL of the Request. More...
 
 addCookie ($name, $value)
 Add a cookie to the request. More...
 
 addCookies (array $cookies)
 Add an array of cookies to the request. More...
 
 addHeader ($header)
 Add a header string to the request. More...
 
 addHeaders (array $headers)
 Add an array of header strings to the request. More...
 
 makePost ()
 Make the request a POST request rather than the default GET request. More...
 
 setPostBody ($body)
 Add a POST body to the request. More...
 
 setSslCaCert ($caCertPath, $validate_cn=true)
 Specify the path to an SSL CA certificate to validate the server with. More...
 
 send ()
 Perform the request. More...
 
 getResponseHeaders ()
 Answer the headers of the response. More...
 
 getResponseStatusCode ()
 Answer HTTP status code of the response. More...
 
 getResponseBody ()
 Answer the body of response. More...
 
 getErrorMessage ()
 Answer a message describing any errors if the request failed. More...
 

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().

+ Here is the caller graph for this function:

◆ 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().

+ Here is the caller graph for this function:

◆ 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().

+ Here is the caller graph for this function:

◆ 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.

The documentation for this class was generated from the following file: