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

Cast the stream to string instead of getting the contents #69

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gisostallenberg
Copy link

PHP FIG PSR-7 describes getContents as "Returns the remaining contents in a string", while the interface description mentions "[...] including serialization of the entire stream to a string.".
For some implementations of PSR-7 the stream is not rewinded and thus getContents turns out to be an empty string in some cases. Also see https://github.com/php-fig/http-message/blob/efd67d1dc14a7ef4fc4e518e7dee91c271d524e4/src/StreamInterface.php#L136-L143 and Nyholm/psr7#135 (comment).

PHP FIG PSR-7 describes getContents as "Returns the *remaining* contents in a string", while the interface description mentions "[...] including serialization of the entire stream to a string.".
For some implementations of PSR-7 the stream is not rewinded and thus getContents turns out to be an empty string in some cases. Also see https://github.com/php-fig/http-message/blob/efd67d1dc14a7ef4fc4e518e7dee91c271d524e4/src/StreamInterface.php#L136-L143 and Nyholm/psr7#135 (comment).
@gisostallenberg
Copy link
Author

@mghoneimy This seems a very trivial PR. Although I understand this might be a project you just handle in your spare time (of which I do not know how much you have) I hope you can spend some time on approving the workflow to be run and checking this PR.

@gisostallenberg
Copy link
Author

@mghoneimy could you respond to this PR?

@saschaende
Copy link

Seems to be abandoned. I will better use another library.

@eiriksm
Copy link

eiriksm commented Nov 5, 2023

Hello @saschaende 👋

From Jul 6th and until now. Did you actually end up going with another library? If so, which one, if I may ask?

@saschaende
Copy link

saschaende commented Nov 6, 2023

Hello @saschaende 👋

From Jul 6th and until now. Did you actually end up going with another library? If so, which one, if I may ask?

REST (!!!)

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

Successfully merging this pull request may close these issues.

None yet

3 participants