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

Problem with HTTP facade and withCookies() function #31750

Closed
adamdyderski opened this issue Mar 4, 2020 · 3 comments
Closed

Problem with HTTP facade and withCookies() function #31750

adamdyderski opened this issue Mar 4, 2020 · 3 comments
Labels

Comments

@adamdyderski
Copy link

adamdyderski commented Mar 4, 2020

Hi,

I have a problem during passing array to withCookies() function of HTTP client facade - Laravel throw an exception:

InvalidArgumentException {#365 #message: "cookies must be an instance of GuzzleHttp\Cookie\CookieJarInterface" #code: 0 #file: "D:\Laravel\api\vendor\guzzlehttp\guzzle\src\Middleware.php" #line: 31 trace: { ... }

After changing parameter type from array to CookieJarInterface in PendingRequest class:

public function withCookies(CookieJarInterface $cookies)

and the CookieJar object is passed, the problem does not occur and everything works fine. Do you know it is Laravel problem or maybe I do something wrong?

@driesvints
Copy link
Member

There's already a PR open: #31745

@driesvints driesvints added the bug label Mar 4, 2020
@adamdyderski
Copy link
Author

@driesvints ok, thanks

@driesvints driesvints changed the title [7.x] Problem with HTTP facade and withCookies() function Problem with HTTP facade and withCookies() function Mar 4, 2020
@driesvints
Copy link
Member

This was fixed in a different way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants