Created
November 30, 2012 19:42
-
-
Save sidchilling/4178045 to your computer and use it in GitHub Desktop.
HttpRequest for POST
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_POST); # METH_POST indicates a POST request | |
$request->addPostFields($data); # use this method to add data to the POST request | |
$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