HttpClient
HttpClient

A simple class for making HTTP requests.

@codeCoverageIgore

Functions
fetchUrl
public function fetchUrl(
$url,
$headers false
)

Fetch the content of  a URL.

Parameters
url

String containing the URL to fetch

header

Optional boolean switch for whether to include headers in the text.  Off by default.

Returns

The page content as a string.

sendPost
public function sendPost(
$url,
$data
)

Send a POST request and get the response.  The request is sent as x-www-form-urlencoded data.

Parameters
url

The URL to which the resquest is sent.

data

The post data to send as a URL-encoded string.

Returns

An HttpResponse object containing the response.