add clear
This commit is contained in:
@@ -300,7 +300,6 @@ class HttpClient
|
|||||||
}
|
}
|
||||||
|
|
||||||
$body = $client->body;
|
$body = $client->body;
|
||||||
var_dump($body);
|
|
||||||
$client->close();
|
$client->close();
|
||||||
|
|
||||||
$header = $client->getHeaders();
|
$header = $client->getHeaders();
|
||||||
@@ -345,7 +344,6 @@ class HttpClient
|
|||||||
*/
|
*/
|
||||||
private function generate_client($host, $url, $data)
|
private function generate_client($host, $url, $data)
|
||||||
{
|
{
|
||||||
var_dump($host, $this->getHostPort(), $url, $this->isSSL);
|
|
||||||
$client = new SClient($host, $this->getHostPort(), $this->isSSL);
|
$client = new SClient($host, $this->getHostPort(), $this->isSSL);
|
||||||
if (!empty($this->agent)) {
|
if (!empty($this->agent)) {
|
||||||
$this->header['User-Agent'] = $this->agent;
|
$this->header['User-Agent'] = $this->agent;
|
||||||
@@ -355,7 +353,6 @@ class HttpClient
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (strtolower($this->method) == self::GET) {
|
if (strtolower($this->method) == self::GET) {
|
||||||
echo $host . ':' . $this->getHostPort() . ' ' . $url . '?' . $data;
|
|
||||||
$client->get($url . '?' . $data);
|
$client->get($url . '?' . $data);
|
||||||
} else if (strtolower($this->method) == self::PUT) {
|
} else if (strtolower($this->method) == self::PUT) {
|
||||||
$client->setMethod('PUT');
|
$client->setMethod('PUT');
|
||||||
@@ -366,10 +363,8 @@ class HttpClient
|
|||||||
$data = json_encode($data, JSON_UNESCAPED_UNICODE);
|
$data = json_encode($data, JSON_UNESCAPED_UNICODE);
|
||||||
}
|
}
|
||||||
$client->setData($data);
|
$client->setData($data);
|
||||||
$execute = $client->execute($url);
|
$client->execute($url);
|
||||||
var_dump($execute);
|
|
||||||
} else {
|
} else {
|
||||||
echo $host . ':' . $this->getHostPort() . ' ' . $url;
|
|
||||||
$client->post($url, $data);
|
$client->post($url, $data);
|
||||||
}
|
}
|
||||||
return $client;
|
return $client;
|
||||||
|
|||||||
Reference in New Issue
Block a user