改名
This commit is contained in:
@@ -46,7 +46,6 @@ class Client extends ClientAbstracts
|
||||
private function coroutine($url, $data = [])
|
||||
{
|
||||
try {
|
||||
var_dump($url);
|
||||
$client = $this->generate_client($data, ...$url);
|
||||
if ($client->statusCode < 0) {
|
||||
throw new Exception($client->errMsg);
|
||||
@@ -79,13 +78,15 @@ class Client extends ClientAbstracts
|
||||
*/
|
||||
private function generate_client($data, $host, $isHttps, $path)
|
||||
{
|
||||
$port = $isHttps ? 443 : $this->getPort();
|
||||
$client = new SClient($host, $port, $this->isSSL());
|
||||
if ($isHttps || $this->isSSL()) {
|
||||
$client = new SClient($host, 443, $this->isSSL());
|
||||
} else {
|
||||
$client = new SClient($host, $this->getPort(), $this->isSSL());
|
||||
}
|
||||
|
||||
if (strpos($path, '/') !== 0) {
|
||||
$path = '/' . $path;
|
||||
}
|
||||
|
||||
$client->set($this->settings());
|
||||
if (!empty($this->getAgent())) {
|
||||
$this->addHeader('User-Agent', $this->getAgent());
|
||||
@@ -93,7 +94,6 @@ class Client extends ClientAbstracts
|
||||
|
||||
$client->setHeaders($this->getHeader());
|
||||
$client->setMethod(strtoupper($this->getMethod()));
|
||||
|
||||
if (strtolower($this->getMethod()) == self::GET && !empty($data)) {
|
||||
$path .= '?' . $data;
|
||||
} else {
|
||||
@@ -103,7 +103,6 @@ class Client extends ClientAbstracts
|
||||
if (!empty($this->getData())) {
|
||||
$client->setData($this->getData());
|
||||
}
|
||||
|
||||
$client->execute($path);
|
||||
$client->close();
|
||||
return $client;
|
||||
|
||||
@@ -747,7 +747,6 @@ abstract class ClientAbstracts extends Component implements IClient
|
||||
private function defaultString($string)
|
||||
{
|
||||
$host = $this->getHost();
|
||||
$host .= ':' . $this->getPort();
|
||||
if ($string == '/') {
|
||||
$string = '';
|
||||
} else if (strpos($string, '/') !== 0) {
|
||||
|
||||
Reference in New Issue
Block a user