http-client
http-client copied to clipboard
Implementing PSR-18 adapter for amphp/http-client v5
Thanks to fibers, the amphp/http-client v5
has a "sync" interface: it gets rid of promises & generators. It is now possible to implement the PSR-18: HTTP Client.
Benefits:
- Any sdk that requires a
psr/http-client-implementation
could become asynchronous when used with AMP. - Any PSR-18 middleware could be used
Your link to psr/http-client-implementation doesn't work, and whom needs such a client anyway?
That's a matter of adoption. Once major sdks will use this interface instead of requiring guzzle or symfony http-client directly (see https://github.com/FriendsOfPHP/well-known-implementations/issues/2), it will be possible to use them asynchronously in an AMP event-loop.
I'm opening this issue to gather feedbacks and find if there is something already existing.
Yes, there's https://github.com/amphp/http-client-psr7/tree/v2 already. However, the README is still old.
I guess this can be closed?
@nicolas-grekas I think it still needs an update.