From ca7a4494d8e1fbff98873959bb8b8afb42c73727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=91=E6=9E=97?= Date: Fri, 24 Dec 2021 14:23:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/AsyncClient.php | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/AsyncClient.php b/src/AsyncClient.php index 66ed762..c177957 100644 --- a/src/AsyncClient.php +++ b/src/AsyncClient.php @@ -107,7 +107,7 @@ class AsyncClient extends ClientAbstracts private function execute(string $path, string $content) { $array = []; - $array[] = strtoupper($this->getMethod()) . ' ' . $path . ' HTTP/1.1'; + $array[] = strtoupper($this->getMethod()) . ' ' . $path . ' HTTP/1.0'; if (!empty($this->getHeader())) { foreach ($this->getHeader() as $key => $value) { $array[] = sprintf('%s: %s', $key, $value); @@ -123,19 +123,9 @@ class AsyncClient extends ClientAbstracts $this->setStatusCode(intval(explode(' ', $status)[1])); $this->parseResponseHeaders($header); - if ($this->getResponseHeader('Transfer-Encoding') == 'chunked') { - $explode = explode("\r\n\r\n", str_replace("0\r\n\r\n", '', $body)); - - var_dump($explode); - - $string = []; - foreach ($explode as $value) { - $string[] = explode("\r\n", $value)[1]; - } - $body = implode($string); - } - file_put_contents('php://output', $body . PHP_EOL); $this->setBody($body); + + var_dump($body); }