A simple class for making HTTP requests.
@codeCoverageIgore
public function fetchUrl( |
| ) |
Fetch the content of a URL.
url | String containing the URL to fetch |
header | Optional boolean switch for whether to include headers in the text. Off by default. |
The page content as a string.
public function sendPost( |
| ) |
Send a POST request and get the response. The request is sent as x-www-form-urlencoded data.
url | The URL to which the resquest is sent. |
data | The post data to send as a URL-encoded string. |
An HttpResponse object containing the response.