Jump to: navigation, search

OpenStack-SDK-PHP/Design/HTTP-Client

In a previous discussion, we mentioned the possibility of using a pluggable HTTP client as the basis of all HTTP connections. The idea is that it can be easy swapped out should an end-user decide to use their own (which would need to implement our ClientInterface).

However, I'm not sure this would ever be needed. Instead, Guzzle's client (and ZF2's) uses connection adapters to offer the same kind of flexibility in a more useful way. You select the type of network connection you want to use (cURL adapter, socket adapter, test adapter) with a common client. I think this is the kind of functionality we were thinking about, not an entirely swappable client itself.

Is there a reason to use a pluggable HTTP client, instead of offering connection adapters?