改名
This commit is contained in:
+17
-3
@@ -122,9 +122,7 @@ class AsyncClient extends ClientAbstracts
|
|||||||
$status = array_shift($header);
|
$status = array_shift($header);
|
||||||
|
|
||||||
$this->setStatusCode(intval(explode(' ', $status)[1]));
|
$this->setStatusCode(intval(explode(' ', $status)[1]));
|
||||||
$this->setResponseHeader($header);
|
$this->parseResponseHeaders($header);
|
||||||
|
|
||||||
var_dump($this->getResponseHeaders());
|
|
||||||
if ($this->getResponseHeader('Transfer-Encoding') == 'chunked') {
|
if ($this->getResponseHeader('Transfer-Encoding') == 'chunked') {
|
||||||
$explode = explode("\r\n\r\n", str_replace("0\r\n\r\n", '', $body));
|
$explode = explode("\r\n\r\n", str_replace("0\r\n\r\n", '', $body));
|
||||||
|
|
||||||
@@ -141,6 +139,22 @@ class AsyncClient extends ClientAbstracts
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param array $headers
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
private function parseResponseHeaders(array $headers)
|
||||||
|
{
|
||||||
|
$array = [];
|
||||||
|
foreach ($headers as $header) {
|
||||||
|
[$key, $value] = explode(': ', $header);
|
||||||
|
|
||||||
|
$array[$key] = $value;
|
||||||
|
}
|
||||||
|
$this->setResponseHeader($array);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $path
|
* @param $path
|
||||||
* @param $data
|
* @param $data
|
||||||
|
|||||||
Reference in New Issue
Block a user