FOSHttpCache icon indicating copy to clipboard operation
FOSHttpCache copied to clipboard

Switch to Symfony HttpClient?

Open andrerom opened this issue 5 years ago • 4 comments

Would it make sense to switch to Symfony HttpClient to reduce setup time with the lib/bundle?

Technically library would only need to rely on symfony/http-client-contracts OR just PSR-18 as proposed in #443 if that covers all our needs. And furthermore rely on symfony/http-client as dev dependency, while bundle maybe relying and wiring that up by default.

andrerom avatar Jul 08 '19 13:07 andrerom

i'd prefer to depend on PSR-18. the symfony http-client has been developped ignoring the efforts of PSR-18. if i remember correctly, there is a PSR-18 adapter that makes a symfony/http-client available as PSR-18 client.

dbu avatar Jul 08 '19 13:07 dbu

There is, PSR-18 is the way to go here👌🏻

Toflar avatar Jul 08 '19 20:07 Toflar

the symfony http-client has been developed ignoring the efforts of PSR-18

I guess they wanted to go beyond what's there, but indeed PSR-18 type hinting would be the way to go in the lib, but for the Bundle we could wire up Symfony HttpClient as the client (via adapter) for instance.

andrerom avatar Jul 09 '19 05:07 andrerom

yep, if we can make the bundle run without further manual steps, that'd be nice. with symfony being split into components, i am not sure if typical installs will have all the necessary components, but thats something to experiment with. at least in the symfony pack, we can (and should) go for the symfony http client.

i marked this with the 3.0 milestone. guess at some point we need to kick off version 3 work.

dbu avatar Jul 09 '19 06:07 dbu

update: if we go PSR-18, we can use httplug/discovery which since recently automatically installs a PSR-18 compatible client if none is specified by the application.

dbu avatar Feb 21 '23 20:02 dbu

closing in favor of #443

dbu avatar Feb 01 '24 13:02 dbu