amphp / http-client

An advanced async HTTP client library for PHP, enabling efficient, non-blocking, and concurrent requests and responses.
https://amphp.org/http-client
MIT License
706 stars 66 forks source link

Implementing PSR-18 adapter for amphp/http-client v5 #306

Open GromNaN opened 2 years ago

GromNaN commented 2 years ago

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:

Bilge commented 2 years ago

Your link to psr/http-client-implementation doesn't work, and whom needs such a client anyway?

GromNaN commented 2 years ago

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.

kelunik commented 2 years ago

Yes, there's https://github.com/amphp/http-client-psr7/tree/v2 already. However, the README is still old.

nicolas-grekas commented 1 year ago

I guess this can be closed?

kelunik commented 1 year ago

@nicolas-grekas I think it still needs an update.