A plugin that is using a Guzzle request is now throwing an exception that the class cannot be found.

I'm running Craft CMS 2.6.3000. Where is Guzzle being pulled from? I can see it within craft/app/vendor/guzzle and also within plugins/oauth/vendor but for some reason this plugin cannot cannot use this class anymore.

It is being referenced as $client = new \GuzzleHttp\Client();

Why can't the class be used?

2 Answers 2


Just a quick guess, but here is what I have on a project I am working on.

$client = new \Guzzle\Http\Client();
$request = $client->get($url);


$client = new \GuzzleHttp\Client();


$client = new \Guzzle\Http\Client();

I have \Http\Client - maybe you are just missing the slash?

  • What's weird though is its been working like this for a while. Maybe a plugin update has caused this, I'm not sure. Commented Dec 13, 2017 at 18:29
  • I get Call to undefined method Guzzle\Http\Client::request() when using that version for $client. Commented Dec 13, 2017 at 18:36

Actually the class to be used should be:

$client = new GuzzleHttp\Client();

without the first back slash

  • This should be posted as comment on the accepted answer, which includes the bulk of this information—but may contain syntactic issues for some environments. Commented Oct 20, 2021 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.