add clear
This commit is contained in:
@@ -399,28 +399,31 @@ class HttpClient
|
||||
if (!empty($this->header)) {
|
||||
$client->setHeaders($this->parseHeaderMat());
|
||||
}
|
||||
if (!empty($this->_data)) {
|
||||
$client->setData($this->_data);
|
||||
}
|
||||
if (strtolower($this->method) == self::GET) {
|
||||
if (!empty($this->_data)) {
|
||||
$client->setData($this->_data);
|
||||
}
|
||||
if (!empty($data)) {
|
||||
$url .= '?' . $data;
|
||||
}
|
||||
$client->get($url);
|
||||
} else if (strtolower($this->method) == self::PUT) {
|
||||
$client->setMethod('PUT');
|
||||
var_dump($data);
|
||||
if (!is_string($data)) {
|
||||
$data = json_encode($data);
|
||||
}
|
||||
$client->setData($data);
|
||||
if (!empty($data)) {
|
||||
$client->setData($data);
|
||||
}
|
||||
$client->execute($url);
|
||||
} else if (strtolower($this->method) == self::DELETE) {
|
||||
$client->setMethod('DELETE');
|
||||
if (!is_string($data)) {
|
||||
$data = json_encode($data);
|
||||
}
|
||||
$client->setData($data);
|
||||
if (!empty($data)) {
|
||||
$client->setData($data);
|
||||
}
|
||||
$client->execute($url);
|
||||
} else {
|
||||
$client->post($url, $data);
|
||||
|
||||
Reference in New Issue
Block a user