Comments (5)
I couldn't find the actual problem but I think the bug is located when calling the
GuzzleHttp\Message\Response through the subscribed guzzle client.
v 2.1.0: php $response->getBody()->getContents(); // returns the content as string
v 2.2.0: php $response->getBody()->getContents(); // returns empty string ''
When the response body is cast to string all works again.
(string)$response->getBody()
Got any ideas?
from guzzle-oauth2-plugin.
It probably means that the body has been read before somewhere. It's a stream:
$body = $response->getBody();
$body->getContents(); // string, on the first call
$body->getContents(); // empty string on subsequent calls
$body->seek(0);
$body->getContents(); // string again
from guzzle-oauth2-plugin.
@pjcdawkins Should I try to rewind my getContents() before calling getContents()?
I don't think the body has been read before. Unless Guzzle (now) does some magic I'm still unaware of. I'll try to report back something useful asap.
from guzzle-oauth2-plugin.
Yes, rewind the body with $body->seek(0)
, before getContents(), and see if that makes a difference
from guzzle-oauth2-plugin.
It works! Thanks.
from guzzle-oauth2-plugin.
Related Issues (16)
- Access Token caching HOT 1
- Password Credentials - Client ID HOT 10
- Guzzle 6 HOT 22
- Get error: Invalid version string "^2.0" HOT 7
- Update to firebase/php-jwt ~3.0 HOT 1
- cache integration for token persistence HOT 3
- Method that gets/creates access_token? ClientCredentials or Oauth2Subscriber HOT 1
- Is this package still alive? HOT 5
- login with login form
- The getConfig Method from the Guzzle ClientInterface will be removed in 8 HOT 2
- Add implicit grant type HOT 1
- AuthorizationCode "redirect_uri" missing HOT 3
- Guzzle 4 support HOT 7
- PasswordCredentials expecting ClientInterface HOT 1
- Config is missing refresh_token HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from guzzle-oauth2-plugin.