diff --git a/common/HttpClient.php b/common/HttpClient.php index 8ce5dc9..7b26302 100644 --- a/common/HttpClient.php +++ b/common/HttpClient.php @@ -327,6 +327,13 @@ class HttpClient if (strtolower($this->method) == self::GET) { echo $host . ':' . $this->getHostPort() . ' ' . $url . '?' . $data; $client->get($url . '?' . $data); + } else if (strtolower($this->method) == self::PUT) { + $client->setMethod('PUT'); + if (!is_string($data)) { + $data = json_encode($data, JSON_UNESCAPED_UNICODE); + } + $client->setData($data); + $client->execute($url); } else { echo $host . ':' . $this->getHostPort() . ' ' . $url; $client->post($url, $data);