From bfcfdf911da5402a32f55ffd6938a3273d06a06a Mon Sep 17 00:00:00 2001 From: Juan Lago Date: Wed, 2 Jun 2021 08:36:51 +0200 Subject: [PATCH] Added "close" method to Http response --- src/Illuminate/Http/Client/Response.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Illuminate/Http/Client/Response.php b/src/Illuminate/Http/Client/Response.php index 1b2fc5fb73cd..d9686692a0c3 100644 --- a/src/Illuminate/Http/Client/Response.php +++ b/src/Illuminate/Http/Client/Response.php @@ -207,6 +207,18 @@ public function onError(callable $callback) return $this; } + /** + * Closes the stream and any underlying resources. + * + * @return $this + */ + public function close() + { + $this->response->getBody()->close(); + + return $this; + } + /** * Get the response cookies. *