From 6f0c564e97b16a22b47ddc9620f4b547efb699c4 Mon Sep 17 00:00:00 2001 From: Administrator Date: Sat, 11 Dec 2021 17:25:27 +0800 Subject: [PATCH] 1 --- src/AsyncClient.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/AsyncClient.php b/src/AsyncClient.php index 6a4ee5d..01907ad 100644 --- a/src/AsyncClient.php +++ b/src/AsyncClient.php @@ -87,8 +87,13 @@ class AsyncClient extends ClientAbstracts $this->withAddedHeader('User-Agent', $this->getAgent()); } + $path = $this->setParams($path, $data); + $content = $this->getData()->getContents(); + + $this->withAddedHeader('Content-Length', $this->getData()->getSize()); + $array = []; $array[] = strtoupper($this->getMethod()) . ' ' . $path . ' HTTP/1.1'; if (!empty($this->getHeader())) { @@ -97,9 +102,9 @@ class AsyncClient extends ClientAbstracts } } $array = implode("\r\n", $array) . "\r\n\r\n"; - $this->client->send($array . $this->getData()->getContents()); + $this->client->send($array . $content); - var_dump($array . $this->getData()->getContents()); + var_dump($array . $content); $revice = $this->client->recv();