Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save CoachBirgit/39b9fed9838a0da143ad to your computer and use it in GitHub Desktop.
Save CoachBirgit/39b9fed9838a0da143ad to your computer and use it in GitHub Desktop.
// API Request
$url = 'http://localhost/um-api/get.user/?id=1';
// Include your public key and token to the URL
$url = add_query_arg('key', '75d9a913782eee3d990e4464ce26213e', $url );
$url = add_query_arg('token', 'bae6ee38cf02a50a0ac8259eed34ceb9', $url );
// Process your request
$request = wp_remote_get( $url );
$response = json_decode( wp_remote_retrieve_body( $request ) , true );
// That's it, now you can use/print the returned response
print_r( $response );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment