Created
October 13, 2016 17:24
-
-
Save rorymcdaniel/ea95000bc68819381352fe824499dd5d to your computer and use it in GitHub Desktop.
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 | |
$wp = new GuzzleHttp\Client(); | |
$request = $wp->get('http://www.example.com/wp-json/wp/v2/users'); | |
$statusCode = $request->getStatusCode(); | |
if($statusCode >= 200 && $statusCode < 300 ) { | |
$users = json_decode($request->getBody()); | |
foreach($users as $user) { | |
//var_dump($user->id); | |
//var_dump($user->name); | |
//var_dump($user->slug); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment