I’ve created a custom module. In the file my_module.module
file I have a function my_module_api_clear_cache
. In that function, I’ve got some variables that I’d like to print and see what I have for example $client
or $request
function my_module_api_clear_cache() { $client= Drupal::httpClient(); try { $request = $client->get($url); $status = $request->getStatusCode(); $file_contents = $request->getBody()->getContents(); } catch (RequestException $e) { //An error happened. } }