Laravel Test HTTP Client Calls

  • Get a test url from
  • Make sure Laravel and Guzzle are installed
  • Go to a directory where Laravel is install.  Run
    php artisan tinker
  • Create a HTTP client
     $client = new \GuzzleHttp\Client();
  • Issue HTTP calls For example:
    $res = $client->request('POST',, ['query' => ['key1' => 'values1', 'key2' => 'value2'], 'verify' => false])`;


    $res = $client->request('POST', '', ['body' => json_encode(['key1' => 'values1', 'key2' => 'value2']), 'verify' => false]);
  • You will see the details of your calls on
  • Note:  to pass 2d array into body, use the json field and do not json_encode the array.