Open zealotrunner opened 9 years ago
I think it'll be easier to use parseWith() if the method support following 'features'.
parseWith()
More 'straight-through' Now we have to
$response = \Httpful\Request::get('http://www.example.com?p=1') ->parseWith(function($body) { // return parsedMessage($body); }) ->send(); $message = $response->body;
My Suggention
$message = \Httpful\Request::get('http://www.example.com?p=1') ->xParseWith(function($body) { // return parsedMessage($body); }) ->send();
Pass $url directly in Now we have to
$url = 'http://www.example.com?p=1'; $response = \Httpful\Request::get($url) ->parseWith(function($body) use($url) { // return parsedMessage($body, $url); }) ->send();
$response = \Httpful\Request::get('http://www.example.com?p=1') ->parseWith(function($body, $url) { // return parsedMessage($body, $url); }) ->send();
In general it would be helpful to know the headers too. In case you need to handle things like uncompression.
I think it'll be easier to use
parseWith()
if the method support following 'features'.More 'straight-through' Now we have to
My Suggention
Pass $url directly in Now we have to
My Suggention