src/Client.php
private function doQuery($method, $url, $data = null)
    {
        $guzzleclient = new GuzzleClient();

        if (false !== stristr($method, 'get')) {
            $res = $guzzleclient->get($this->baseUrl.'/'.$url, [
                'auth' => [$this->username, $this->password],
            ]);
        } else {
            $res = $guzzleclient->post($this->baseUrl.'/'.$url, [
                'auth' => [$this->username, $this->password],
                'json' => $data,
            ]);
        }

        return json_decode($res->getBody(), true);
    }
private function doQuery($method, $url, $data = null)
    {
        $guzzleclient = new GuzzleClient();

        if (false !== stristr($method, 'get')) {
            $res = $guzzleclient->get($this->baseUrl.'/'.$url, [
                'auth' => [$this->username, $this->password],
            ]);
        } else {
            $res = $guzzleclient->post($this->baseUrl.'/'.$url, [
                'auth' => [$this->username, $this->password],
                'json' => $data,
            ]);
        }

        return json_decode($res->getBody(), true);
    }
-----------------------------------------------------------