<p>Using the code below to get 3rd party API</p>
<pre><code>    $uri = $baseUri . '/area/' . $areaId . '.geojson?api_key=' . $mapAPIkey;

    $client = Craft::createGuzzleClient();
    $response= $client-&gt;request('GET',  $uri);
    $data = $response-&gt;getBody();
    return $data;
</code></pre>
<p>Getting error</p>
<pre><code>Class GuzzleHttp\Psr7\Response contains 6 abstract methods and must therefore be declared abstract or implement the remaining methods (Psr\Http\Message\RequestInterface::getRequestTarget, Psr\Http\Message\RequestInterface::withRequestTarget, Psr\Http\Message\RequestInterface::getMethod, ...)
</code></pre>
<p>What is wrong? Ive been through half a dozen other plugins that use guzzle like this and they seem to be ok</p>

CC BY-SA 4.0
2021-09-29T10:17:27.870Z
What does your `composer.json` say – which version of `guzzlehttp/guzzle` are you using?
MoritzLost
CC BY-SA 4.0
2021-09-30T11:05:37.273Z
Plugin composer doesn't have a require guzzle. I though it was native to craft? Do I need to :
use GuzzleHttp;
joomkit
CC BY-SA 4.0
2021-09-30T11:55:10.907Z
Guzzle is required by Craft, though Craft's [composer.json allows both Guzzle 6 and Guzzle 7](https://github.com/craftcms/cms/blob/develop/composer.json#L43). If you're using Guzzle in your own code, you should add it to your own dependencies. Try requiring version 7 explicitly, maybe you've gotten version 6 for some reason and there's something going wrong there: `composer require guzzlehttp/guzzle:^7.3`
MoritzLost
CC BY-SA 4.0
2021-10-03T18:18:23.607Z
Problem seems to have resolved itself  "guzzlehttp/guzzle": "^6.5.5|^7.2.0"
Thanks for the reply
joomkit
<craft3><plugin-development><api><guzzle>
Guzzle fatal error using Craft Guzzle client
# Guzzle fatal error using Craft Guzzle client

(Asked by: username_0 on 2021-09-21)

Using the code below to get 3rd party API
    $uri = $baseUri . '/area/' . $areaId . '.geojson?api_key=' . $mapAPIkey;

    $client = Craft::createGuzzleClient();
    $response= $client->request('GET',  $uri);
    $data = $response->getBody();
    return $data;

Getting error
Class GuzzleHttp\Psr7\Response contains 6 abstract methods and must therefore be declared abstract or implement the remaining methods (Psr\Http\Message\RequestInterface::getRequestTarget, Psr\Http\Message\RequestInterface::withRequestTarget, Psr\Http\Message\RequestInterface::getMethod, ...)

What is wrong? Ive been through half a dozen other plugins that use guzzle like this and they seem to be ok

**Tags:** craft3, plugin-development, api, guzzle
> **Comments:**
> **username_1**: What does your `composer.json` say – which version of `guzzlehttp/guzzle` are you using?  
> **username_0**: Plugin composer doesn't have a require guzzle. I though it was native to craft? Do I need to : use GuzzleHttp;  
> **username_1**: Guzzle is required by Craft, though Craft's [composer.json allows both Guzzle 6 and Guzzle 7](https://github.com/craftcms/cms/blob/develop/composer.json#L43). If you're using Guzzle in your own code, you should add it to your own dependencies. Try requiring version 7 explicitly, maybe you've gotten version 6 for some reason and there's something going wrong there: `composer require guzzlehttp/guzzle:^7.3`  
> **username_0**: Problem seems to have resolved itself  "guzzlehttp/guzzle": "^6.5.5|^7.2.0" Thanks for the reply  

---

## 0 answers

