55use Http \Client \Exception ;
66use Http \Client \HttpClient ;
77use Http \Message \MessageFactory ;
8+ use Psr \Http \Message \RequestInterface ;
89use Psr \Http \Message \ResponseInterface ;
910use Psr \Http \Message \StreamInterface ;
1011use Psr \Http \Message \UriInterface ;
1819 * ->post('/bar')
1920 * ;
2021 *
22+ * The client also exposes the sendRequest methods of the wrapped HttpClient.
23+ *
2124 * @author Márk Sági-Kazár <[email protected] > 2225 * @author David Buchmann <[email protected] > 2326 */
24- class HttpMethodsClient
27+ class HttpMethodsClient implements HttpClient
2528{
2629 /**
2730 * @var HttpClient
@@ -171,9 +174,29 @@ public function options($uri, array $headers = [], $body = null)
171174 }
172175
173176 /**
174- * Sends a request
177+ * Forward to the underlying HttpClient.
178+ *
179+ * {@inheritdoc}
180+ */
181+ public function sendRequest (RequestInterface $ request )
182+ {
183+ $ this ->httpClient ->sendRequest ($ request );
184+ }
185+
186+ /**
187+ * Forward to the underlying HttpClient.
188+ *
189+ * {@inheritdoc}
190+ */
191+ public function sendRequests (array $ requests )
192+ {
193+ $ this ->httpClient ->sendRequests ($ requests );
194+ }
195+
196+ /**
197+ * Sends a request.
175198 *
176- * @param string $method
199+ * @param string $method HTTP method to use.
177200 * @param string|UriInterface $uri
178201 * @param array $headers
179202 * @param string|StreamInterface|null $body
@@ -184,7 +207,7 @@ public function options($uri, array $headers = [], $body = null)
184207 */
185208 protected function send ($ method , $ uri , array $ headers = [], $ body = null )
186209 {
187- return $ this ->httpClient -> sendRequest ($ this ->messageFactory ->createRequest (
210+ return $ this ->sendRequest ($ this ->messageFactory ->createRequest (
188211 $ method ,
189212 $ uri ,
190213 '1.1 ' ,
0 commit comments