DEV Community

loading...

Discussion on: Building HTTP clients with Guzzle

Collapse
titasgailius profile image
Titas Gailius Author

So you basically have an example 2/3 in mind but decoupling guzzle with http-plug, right?

Collapse
aleksikauppila profile image
Aleksi Kauppila

I re-read the post and realized you were talking about integration, heh. I'll extend my comment a bit. So yes, i would write an adapter for Guzzle. If i didn't have to write that integration myself and the case would be using a library like twitteroauth then adapter again with a TwitterApi interface or something.

In case of writing the integration myself i'd be still trying my best to make it irrelevant that i'm using guzzle or even a http client at all. After all, the client probably only cares about the data that the integration provides. This is pretty speculative as i haven't really gotten around to build any kind of meaningful abstraction over these kinds of integrations.