dimanche 23 septembre 2018

Variables using Guzzle not going through (Lumen)

I have:

<?php

namespace App\Console\Commands;

use Illuminate\Console\Command;
use GuzzleHttp\Client;

class GetBlahCommand extends Command {

    protected $name = 'blah:blah';
    protected $description = "name";

    public function handle()
    {
        $client = new Client();
        $res = $client->request('GET', 'https://someapi.com', [
            'api_key' => ['privatekey']
        ]);
        echo $res->getStatusCode();
    }
}

But the param api_key isn't being passed along.

How can I get this to work?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire