Skip to content

Add new request() and requestStreaming() methods and deprecate send() method and streaming option#170

Merged
clue merged 2 commits intoclue:masterfrom
clue-labs:request
Jun 28, 2020
Merged

Add new request() and requestStreaming() methods and deprecate send() method and streaming option#170
clue merged 2 commits intoclue:masterfrom
clue-labs:request

Conversation

@clue
Copy link
Owner

@clue clue commented Jun 27, 2020

This changeset introduces two new methods, request() and requestStreaming().

The request() method can be used to send arbitrary HTTP requests and deprecates the send() method:

// old: deprecated
$browser->send(new Request('OPTIONS', $url));

// new
$browser->request('OPTIONS', $url);

The requestStreaming() method can be used to send an arbitrary HTTP request and receive a streaming response without buffering the response body:

// old: deprecated
$browser->withOptions(['streaming' => true])->get($url);

// new
$browser->requestStreaming('GET', $url);

Refs #154 and #56 and others.
Builds on top of #162, #167 and #168

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant