phpvms/app/Console/Commands/TestApi.php
Nabeel S dc51897314
Additional logging for the stats recalculation (#358)
* Additional logging for the stats recalculation

* style fix
2019-08-10 20:42:35 -04:00

39 lines
826 B
PHP

<?php
namespace App\Console\Commands;
use App\Console\Command;
use GuzzleHttp\Client;
/**
* Class TestApi
*/
class TestApi extends Command
{
protected $signature = 'phpvms:test-api {apikey} {url}';
protected $httpClient;
public function __construct()
{
parent::__construct();
$this->redirectLoggingToFile('stdout');
}
/**
* Run dev related commands
*/
public function handle()
{
$this->httpClient = new Client([
'headers' => [
'Authorization' => $this->argument('apikey'),
'Content-type' => 'application/json',
'X-API-Key' => $this->argument('apikey'),
],
]);
$result = $this->httpClient->get($this->argument('url'));
echo $result->getBody();
}
}