I have a demo.php, in it I have a button:
<?php
include('../library/Requests.php');
Requests::register_autoloader();
function get_data(){
$request = Requests::post('http://localhost:8000/api/groups/list/', array(), null);
var_dump($request);
}
?>
<button>Click Me</button>
How can I trigger the get_data method in my demo.php? Who can tell me the solution?