<p>Actually the class to be used should be:</p>
<p>$client = new GuzzleHttp\Client();</p>
<p>without the first back slash</p>

CC BY-SA 4.0
2021-10-20T15:45:07.057Z
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.
August Miller
CC BY-SA 4.0
2021-10-15T20:51:34.247Z
2021-10-15T20:51:34.247Z
kelvin2710
<p>Just a quick guess, but here is what I have on a project I am working on.    </p>

<pre><code>$client = new \Guzzle\Http\Client();
$request = $client-&gt;get($url);
</code></pre>

<p><strong>yours</strong></p>

<pre><code>$client = new \GuzzleHttp\Client();
</code></pre>

<p><strong>mine</strong></p>

<pre><code>$client = new \Guzzle\Http\Client();
</code></pre>

<p>I have <code>\Http\Client</code> - maybe you are just missing the slash?</p>

CC BY-SA 3.0
2017-12-13T18:29:57.183Z
What's weird though is its been working like this for a while. Maybe a plugin update has caused this, I'm not sure.
James White
CC BY-SA 3.0
2017-12-13T18:36:52.973Z
I get `Call to undefined method Guzzle\Http\Client::request()` when using that version for $client.
James White
CC BY-SA 3.0
2017-12-13T18:27:32.620Z
2017-12-13T18:27:32.620Z
Damon
<p>A plugin that is using a Guzzle request is now throwing an exception that the class cannot be found.</p>

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

<p>It is being referenced as <code>$client = new \GuzzleHttp\Client();</code></p>

<p>Why can't the class be used?</p>

<guzzle>
Class 'GuzzleHttp\Client' not found
# Class 'GuzzleHttp\Client' not found

(Asked by: username_0 on 2017-12-13)

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?

**Tags:** guzzle

---

## 2 answers

### Answer by username_1 on 2021-10-15. Score: 1

Actually the class to be used should be:

$client = new GuzzleHttp\Client();

without the first back slash

> **Comments:**
> **username_2**: 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.  

---

### Answer by username_3 on 2017-12-13. Score: 1

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);

yours
$client = new \GuzzleHttp\Client();

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

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

> **Comments:**
> **username_0**: What's weird though is its been working like this for a while. Maybe a plugin update has caused this, I'm not sure.  
> **username_0**: I get `Call to undefined method Guzzle\Http\Client::request()` when using that version for $client.  

---

