-
-
Notifications
You must be signed in to change notification settings - Fork 65
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
Simplify acessing response body #48
Comments
While try I like to keep streaming without storing data posssible, maybe #29 is a way to achieve this? Now the question is which one do we want to be the default. I personally think that easy access to the response body should be the default, and streaming it in should be a secondary option |
Minor progress update: #70 has been implemented, which means that one can now use ReactPHP's normal stream primitives to buffer the whole request body: $request = $client->request('GET', 'https://google.com/');
$request->on('response', function (Response $response) {
\React\Promise\Stream\buffer($response)->then(function ($body) {
echo $body;
}, 'printf');
});
$request->end(); We're still working on a simpler API for #41 👍 |
@clue It seems the function |
@slince This function is from the react/promise-stream package. composer req react/promise-stream |
@jsor thks |
I'm closing this as it is already supported by the new HTTP client that has been merged into |
Accessing the HTTP response body is likely one of the main use cases for this library, however it's actually unnecessarily cumbersome.
This has come up several times already, so we way want to look into providing a simpler API.
Possibly related to #41.
The text was updated successfully, but these errors were encountered: