-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
RFI: Deprecation of send() #178
Comments
@shaunbramley Thanks for bringing this up, I think it's an excellent question! The The main motivation for this is that the previous options have been replaced with dedicated methods to configure the The
Not at all. I think PSR-7 message abstractions are an excellent choice for this library (and react/http). I think we can still discuss having (i.e. re-introducing) a At the moment, I think the cons outweigh the pros and using this below logic seems like a good compromise: // old
$browser->send($request);
// new
$browser->request(
$request->getMethod(),
(string) $request->getUri(),
$request->getHeaders(),
(string) $request->getBody()
); It's not perfect, but it gets the job done. I'm happy to hear your thoughts on this 👍 |
I believe this has been answered, so I'm closing this for now. Please come back with more details if this questions persists and we can reopen this 👍 |
Changeset as listed in #170 highlights that
Browser::send()
has been deprecated. #170 also makes reference to #56, #154, #162, #167, and #168; all of which revolve around API updates and test suite improvements.As per a DM with @clue I am submitting this "issue" as an RFI for technical reasons behind deprecation of
send()
.It feels odd that a "PSR-7 HTTP client" (shamelessly copied from README.md) does not (or rather will not) have a publicly available method that sends a previously created PSR-7 request.
The transactional methods (get, put, head, post, etc, etc) all proxy through
requestMayBeStreaming()
which generates a PSR-7 request which in turn is used inTransaction::send()
.Is the intent to shift away from PSR-7 as the browser moves forward (under react/http)?
send()
made it easier to move from Guzzle to a React based application. My most common use case is that the browser is wrapped in a middleware type architecture where the request type is not necessarily known (or cared about) and specific actions are added onto the promise chain based on specific criteria.The text was updated successfully, but these errors were encountered: