Created
November 30, 2012 19:50
-
-
Save sidchilling/4178106 to your computer and use it in GitHub Desktop.
GET requests with Requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| require_once('./requests/library/Requests.php'); # have to require this single file | |
| Requests::register_autoloader(); # needed by Requests class to autoload internal classes | |
| $response = Requests::request($url, array(), $data); # The empty array is for headers if you want to send any | |
| if ($response->success) { | |
| $response = json_decode($response->body); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment