72 'Request has already been sent cannot '.__METHOD__
92 'Request has already been sent cannot '.__METHOD__
96 $this->cookies[$name] = $value;
113 'Request has already been sent cannot '.__METHOD__
117 $this->cookies = array_merge($this->cookies,
$cookies);
132 'Request has already been sent cannot '.__METHOD__
151 'Request has already been sent cannot '.__METHOD__
155 $this->headers = array_merge($this->headers,
$headers);
168 'Request has already been sent cannot '.__METHOD__
172 $this->isPost =
true;
187 'Request has already been sent cannot '.__METHOD__
190 if (!$this->isPost) {
192 'Cannot add a POST body to a GET request, use makePost() first.'
196 $this->postBody = $body;
212 'Request has already been sent cannot '.__METHOD__
216 $this->validateCN = $validate_cn;
233 'Request has already been sent cannot send again.'
236 if (is_null($this->url) || !$this->url) {
238 'A url must be specified via setUrl() before the request can be sent.'
261 $this->_responseHeaders = array_merge($this->_responseHeaders,
$headers);
273 $this->_responseHeaders[] =
$header;
285 $this->_responseBody = $body;
297 $this->_errorMessage .= $message;
314 'Request has not been sent yet. Cannot '.__METHOD__
330 'Request has not been sent yet. Cannot '.__METHOD__
335 '/HTTP\/[0-9.]+\s+([0-9]+)\s*(.*)/',
336 $this->_responseHeaders[0], $matches
340 'Bad response, no status code was found in the first line.'
344 return intval($matches[1]);
357 'Request has not been sent yet. Cannot '.__METHOD__
374 '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.