改名
This commit is contained in:
+10
-3
@@ -116,16 +116,23 @@ class AsyncClient extends ClientAbstracts
|
||||
$this->client->send(implode("\r\n", $array) . "\r\n\r\n" . $content);
|
||||
$revice = $this->client->recv();
|
||||
|
||||
var_dump($revice);
|
||||
|
||||
[$header, $body] = explode("\r\n\r\n", $revice);
|
||||
|
||||
$header = explode("\r\n", $header);
|
||||
$status = array_shift($header);
|
||||
|
||||
$this->setBody($body);
|
||||
$this->setStatusCode(intval(explode(' ', $status)[1]));
|
||||
$this->setResponseHeader($header);
|
||||
|
||||
if ($this->getResponseHeader('Transfer-Encoding') == 'chunked') {
|
||||
$explode = explode("\r\n\r\n", str_replace("0\r\n\r\n", '', $body));
|
||||
$string = [];
|
||||
foreach ($explode as $value) {
|
||||
$string[] = explode("\r\n", $value)[1];
|
||||
}
|
||||
$body = implode($string);
|
||||
}
|
||||
$this->setBody($body);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user