Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error: Argument 3 passed to GuzzleHttp\Client::request() must be of the type array, string given, called in /srv/share/vendor/guzzlehttp/guzzle/src/Client.php on line 89 #1994

Closed
klausbreyer opened this issue Jan 25, 2018 · 3 comments

Comments

@klausbreyer
Copy link

klausbreyer commented Jan 25, 2018

Q A
Bug? yes
New Feature? no
Version 6.3.0)

Error

screen shot 2018-01-25 at 11 52 44

Type error: Argument 3 passed to GuzzleHttp\Client::request() must be of the type array, string given, called in /srv/share/vendor/guzzlehttp/guzzle/src/Client.php on line 89

Steps to Reproduce

 $response = $this->guzzleClient->send($this->guzzleClient->createRequest($method, $url, ['body' => 'changedthisrightnow.']));

For completeness:

$this->guzzleClient = new \GuzzleHttp\Client(
            [
                'base_url' => [
                    'https://api.easybill.de/rest/{version}/',
                    ['version' => 'v1'],
                ],
                'defaults' => [
                    'headers' => [
                        'Accept' => 'application/json',
                        'Authorization' => sprintf('Bearer %s', $apiKey),
                    ],
                ],
            ]
        );```

@sagikazarmark
Copy link
Member

There is no such method as createRequest and the magic __call function gets called, which in turn calls request with wrong parameters. Leave the call to that method entirely and just call send, it should work.

@crazytonyi
Copy link

createRequest is a 5.3 method.

@gmponos
Copy link
Member

gmponos commented Jan 2, 2020

We haven't received any feedback about this issue and it does not seem like a bug of guzzle.

For support please use other channels that are listed here: https://github.com/guzzle/.github/blob/master/.github/SUPPORT.md

@gmponos gmponos closed this as completed Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants