\cge_http

A set of utility functions for performing http requests.

This class uses an embedded http object, which in turn relies on curl (or attempts to use fsockupeon if all else fails) to perform http requests.

Summary

Methods
Properties
Constants
reset()
get_http()
post()
get()
status()
result()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

reset()

reset()

Reset the http object state to default values.

get_http()

get_http() : \http

Get the internal HTTP object

Returns

\http

post()

post(string $URL, array $data, string $referer) : string

Send a POST request to the specified URL

Parameters

string $URL

The specified data

array $data

Data to associate with the URL

string $referer

An optional referer string. If not specified, a preset value is used.

Returns

string —

The HTML or other data returned from the request."

get()

get(string $URL, string $referer, bool $use_curl) : string

Send a GET request to the specified URL.

This method will use file_get_contents to read the URL if curl is not available, or use_curl is set to false.

Parameters

string $URL
string $referer

An optional referer string

bool $use_curl

Returns

string

status()

status() : int

Get the status of the last http request

Returns

int

result()

result() : string

Get the result of the last http request

Returns

string