70                'Request has already been sent cannot ' . __METHOD__
 
   90                'Request has already been sent cannot ' . __METHOD__
 
   94        $this->cookies[
$name] = $value;
 
  111                'Request has already been sent cannot ' . __METHOD__
 
  115        $this->cookies = array_merge($this->cookies, 
$cookies);
 
  130                'Request has already been sent cannot ' . __METHOD__
 
  149                'Request has already been sent cannot ' . __METHOD__
 
  153        $this->headers = array_merge($this->headers, 
$headers);
 
  166                'Request has already been sent cannot ' . __METHOD__
 
  170        $this->isPost = 
true;
 
  185                'Request has already been sent cannot ' . __METHOD__
 
  188        if (!$this->isPost) {
 
  190                'Cannot add a POST body to a GET request, use makePost() first.' 
  194        $this->postBody = $body;
 
  210                'Request has already been sent cannot ' . __METHOD__
 
  214        $this->validateCN = $validate_cn;
 
  231                'Request has already been sent cannot send again.' 
  234        if (is_null($this->url) || !$this->url) {
 
  236                'A url must be specified via setUrl() before the request can be sent.' 
  259        $this->_responseHeaders = array_merge($this->_responseHeaders, 
$headers);
 
  271        $this->_responseHeaders[] = 
$header;
 
  283        $this->_responseBody = $body;
 
  312                'Request has not been sent yet. Cannot ' . __METHOD__
 
  328                'Request has not been sent yet. Cannot ' . __METHOD__
 
  333            '/HTTP\/[0-9.]+\s+([0-9]+)\s*(.*)/',
 
  334            $this->_responseHeaders[0],
 
  339                'Bad response, no status code was found in the first line.' 
  343        return intval($matches[1]);
 
  356                'Request has not been sent yet. Cannot ' . __METHOD__
 
  373                'Request has not been sent yet. Cannot ' . __METHOD__
 
An exception for terminatinating execution or to throw for unit testing.
This class defines Exceptions that should be thrown when the sequence of operations is invalid.
Provides support for performing web-requests via curl.
sendRequest()
Send the request and store the results.
getResponseBody()
Answer the body of response.
storeErrorMessage($message)
Add a string to our error message.
storeResponseBody($body)
Store the response body.
getResponseStatusCode()
Answer HTTP status code of the response.
getErrorMessage()
Answer a message describing any errors if the request failed.
addCookies(array $cookies)
Add an array of cookies to the request.
setUrl($url)
Set the URL of the Request.
addHeaders(array $headers)
Add an array of header strings to the request.
addHeader($header)
Add a header string to the request.
setPostBody($body)
Add a POST body to the request.
setSslCaCert($caCertPath, $validate_cn=true)
Specify the path to an SSL CA certificate to validate the server with.
send()
Perform the request.
makePost()
Make the request a POST request rather than the default GET request.
storeResponseHeaders(array $headers)
Store the response headers.
storeResponseHeader($header)
Store a single response header to our array.
addCookie($name, $value)
Add a cookie to the request.
getResponseHeaders()
Answer the headers of the response.
An Exception for problems performing requests.
This interface defines a class library for performing web requests.
catch(Exception $e) $message