reactphp / reactphp

Event-driven, non-blocking I/O with PHP.

Home Page:https://reactphp.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hi, problem with getting response back

SerjoA opened this issue · comments

$request->on('response', function (Response $response) use ($request) {

	    $response->on('data', function ($chunk) use ($request) {
	    	$request->end();
	    	$request->close();
	    	dd( $chunk);
	    });

why only dd($chunk) will give me result, if i do return $chunk it wont give me anything

Hi @SerjoA and welcome to React :-)

It's a bit unclear what you're trying to achieve from the snippet you've posted.

It looks like you may want to look at the http-client examples here: https://github.com/reactphp/http-client/tree/master/examples

I hope this helps 👍