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__
makePost()
Make the request a POST request rather than the default GET request.
addCookies(array $cookies)
Add an array of cookies to the request.
setSslCaCert($caCertPath, $validate_cn=true)
Specify the path to an SSL CA certificate to validate the server with.
addCookie($name, $value)
Add a cookie to the request.
getErrorMessage()
Answer a message describing any errors if the request failed.
setPostBody($body)
Add a POST body to the request.
This interface defines a class library for performing web requests.
setUrl($url)
Set the URL of the Request.
Provides support for performing web-requests via curl.
addHeader($header)
Add a header string to the request.
catch(Exception $e) $message
This class defines Exceptions that should be thrown when the sequence of operations is invalid...
getResponseStatusCode()
Answer HTTP status code of the response.
An Exception for problems performing requests.
storeErrorMessage($message)
Add a string to our error message.
getResponseBody()
Answer the body of response.
sendRequest()
Send the request and store the results.
addHeaders(array $headers)
Add an array of header strings to the request.
storeResponseHeaders(array $headers)
Store the response headers.
storeResponseHeader($header)
Store a single response header to our array.
storeResponseBody($body)
Store the response body.
send()
Perform the request.
getResponseHeaders()
Answer the headers of the response.