In case you came here because you googled "Guzzle returns cURL error 3: malformed" check the client parameter. In some version it's base_uri and other base_url
$client = new Client([ 'base_uri' => 'http://localhost:8000', // <-- base_uri instead of base_url ]);