php-http / utils

[DEPRECATED] HTTP Client Utilities
http://httplug.io
MIT License
2 stars 8 forks source link

HTTP Methods Client implement HttpClient #7

Closed sagikazarmark closed 8 years ago

sagikazarmark commented 8 years ago

Shouldn't the conventional HTTP method client implement the HttpClient interface and behave as a decorator of the underlying client?

joelwurtz commented 8 years ago

Yes, this might be useful, an use case that come to my mind is the usage with elasticsearch where GET requests need to set a body.

This is not feasible in the HttpMethods actually (and that's normal), so the user will have to get HttpClient in order to use the sendRequest method in this case.

Having a decorator of the underlying client will be helpful for that.

sagikazarmark commented 8 years ago

Actually you can solve that by using the send method. (IIRC @dbu mentioned the same use case)