HTTP_R File Request Class Version 1.0
The HTTP_R class is a simple PHP class what allows you to request external or local files with ease, the class has four file request methods plus a auto detect method. The auto detect method detects what file request method can be used on your host and then uses it to request the data, the auto detect method is ideal to use if you’re not sure that your host supports curl, file_get_contents, or other request methods.
Example Code Using Envato API:
// Require the class. require_once('HTTP_R.class.php'); // Request & decode the data. $request = HTTP_R::M0('http://marketplace.envato.com/api/v3/user:j4ke.json'); $decode = json_decode($request, true); // Return the wanted data. echo $decode['user']['username'] . ' has made ' . $decode['user']['sales'] . ' sales.';
Updates are free to anyone who has purchased this item with any type of license.
- 1 Nov, 2014 – is_absolute function added because curl doesn’t accept local files.
Please check the support section of my profile, feel free to suggest new features, ask questions, and anything else related to this item by sending me a PM or commenting on this item. If you have purchased this item and like it please remember to rate it.