Missing interfaces for HTTP-Client middlewares using PSR-7 messages.
interface ClientInterface
{
/**
* @param \Psr\Http\Message\RequestInterface $request
* @param array $options - Vendor-specific options, don't rely on for interop.
*
* @return \Psr\Http\Message\ResponseInterface
*/
public function send(RequestInterface $request, array $options = []);
}
On Aug 7, 2015 5:09 AM, "Luis Pabón" <cop...@gmail.com> wrote:
>
> Hello,
>
> I also feel the client interface is missing, otherwise you're creating a hard dependency on your application to a specific HTTP client such as guzzle, instead of fully relying on abstraction. This makes swapping HTTP clients very difficult indeed.
>
> Guzzle's ClientInterface is good, all methods within already rely on PSR-7 interfaces instead of Guzzle's own.
>
> What's the justification for not including a client interface to begin with?
A client interface required message abstractions, and we felt these were sufficiently complex to warrant their own standard. Additionally, those messages can be consumed not just by clients, but server-side applications; including a client interface would have had the unfortunate side-effect of suggesting they were only targeting http clients, and limited adoption.
If you would like to see a standard around clients, I suggest proposing one. Now that PSR-7 is in place, it should be much less complex and easier to get consensus.
> --
> You received this message because you are subscribed to the Google Groups "PHP Framework Interoperability Group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to php-fig+u...@googlegroups.com.
> To post to this group, send email to php...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/php-fig/96e68df8-c05c-44d5-a579-ae134f904fa2%40googlegroups.com.
>
> For more options, visit https://groups.google.com/d/optout.