Created
November 30, 2012 19:38
-
-
Save sidchilling/4178024 to your computer and use it in GitHub Desktop.
HttpRequest for GET
This file contains 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 | |
$request = new HttpRequest($url, HttpRequest::METH_GET); # METH_GET signifies it is a GET request | |
$request->addQueryData($data); # $data is the array with the parameters to send | |
$request->send(); | |
if ($request->getResponseCode() == 200) { | |
$response = json_decode($request->getResponseBody()); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment