(c) 2011 Travis Dent [email protected]
$api = new RestClient(
'base_url' => "http://api.twitter.com/1/",
'format' => "json"
);
$result = $api->get("statuses/public_timeline");
if($result->info->http_code == 200)
json_decode($result->response);
headers - An associative array of HTTP headers and values to be included in every request.
curl_options - cURL options to apply to every request. These will override any internally generated values.
user_agent - User agent string.
base_url - URL to use for the base of each request.
format - Format to append to resource.
username - Username to use for basic authentication. Requires password.
password - Password to use for basic authentication. Requires username.
Options can be set upon instantiation, or individually afterword:
$api = new RestClient(array(
'format' => "json",
'user_agent' => "my-application/0.1"
));
-or-
$api = new RestClient;
$api->set_option('format', "json");
$api->set_option('user_agent', "my-application/0.1");