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

str function is not rewinding the body #101

Closed
gmponos opened this issue Jun 21, 2016 · 4 comments
Closed

str function is not rewinding the body #101

gmponos opened this issue Jun 21, 2016 · 4 comments

Comments

@gmponos
Copy link
Member

gmponos commented Jun 21, 2016

If I use the function str(MessageInterface $message) I have to manually rewind the body of the message.

I am just wondering. Is this the desirable behaviour? I was expecting that it would automatically rewind the message body.

@Tobion
Copy link
Member

Tobion commented Jul 22, 2016

I think the less magic the better. Stream::__toString does not rewind the body after returning the contents either. So I don't think str should rewind the body.

@gmponos
Copy link
Member Author

gmponos commented Jul 23, 2016

OK.. I got you point. But what will happen at this line of code?
https://github.com/guzzle/guzzle/blob/master/src/MessageFormatter.php#L88

You see... I have created my own custom logger middleware and I copy pasted some things from there.
After my LoggerMiddelware was reading the message the next middleware had an empty response. Maybe it's something wrong I did on my middleware I haven't tested this MessageFormatter.

@sagikazarmark
Copy link
Member

See my answer here: guzzle/guzzle#1262 (comment)

@gmponos
Copy link
Member Author

gmponos commented Nov 6, 2016

Yea.. I have seen it before. I believe we can consider this issue closed.

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

No branches or pull requests

3 participants