From 61a226bc0fa9c4acb5692f0f6360a333def0748f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Tue, 6 Apr 2021 16:00:27 +0800 Subject: [PATCH] add clear --- wchat/common/HttpClient.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wchat/common/HttpClient.php b/wchat/common/HttpClient.php index ace369d..ec4546c 100644 --- a/wchat/common/HttpClient.php +++ b/wchat/common/HttpClient.php @@ -695,7 +695,6 @@ class HttpClient if (!is_string($data)) { curl_setopt($ch, CURLOPT_POSTFIELDS, $this->mergeParams($data)); } else { - var_dump($data); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); } } @@ -785,7 +784,7 @@ class HttpClient if (is_array($body)) { return $body; } - $type = $data['content-type'] ?? $data['Content-Type'] ?? 'text/html'; + $type = isset($data['content-type']) ? $data['content-type'] : (isset($data['Content-Type']) ? $data['Content-Type'] : 'text/html'); if (strpos($type, 'text/html') !== false) { return $body; } else if (strpos($type, 'json') !== false) {