add clear

This commit is contained in:
2020-05-22 15:17:24 +08:00
parent 0a3c8ad5c3
commit 9c415292a4
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ abstract class Subject extends Miniprogarampage
$params = json_encode($params, JSON_UNESCAPED_UNICODE);
$this->request->setIsSSL(true);
$this->request->addHeader('content-type', 'application/json');
$this->request->addHeader('Content-Type', 'application/json');
$this->request->setErrorField('errcode');
$this->request->setErrorMsgField('errmsg');
+1 -1
View File
@@ -128,7 +128,7 @@ abstract class Template extends Miniprogarampage
}
$params = json_encode($params, JSON_UNESCAPED_UNICODE);
$this->request->setIsSSL(true);
$this->request->addHeader('content-type', 'application/json');
$this->request->addHeader('Content-Type', 'application/json');
$this->request->setErrorField('errcode');
$this->request->setErrorMsgField('errmsg');
$result = $this->request->post($url, $params);
+1 -1
View File
@@ -706,7 +706,7 @@ class HttpClient
if (is_array($body)) {
return $body;
}
$type = $data['content-type'] ?? 'text/html';
$type = $data['Content-Type'] ?? 'text/html';
if (strpos($type, 'text/html') !== false) {
return $body;
} else if (strpos($type, 'json') !== false) {
+1 -1
View File
@@ -85,7 +85,7 @@ class SourceMaterial extends AfficialAccount
{
$uploadInfo['media'] = new \CURLFile($file);
$uploadInfo['form-data[filename]'] = $uploadInfo['media']->getFilename();
$uploadInfo['form-data[content-type]'] = $uploadInfo['media']->getMimeType();
$uploadInfo['form-data[Content-Type]'] = $uploadInfo['media']->getMimeType();
$accessToken = $this->config->getAccessToken();
+1 -1
View File
@@ -249,7 +249,7 @@ class Message extends SmallProgram
$real_path = new \CURLFile(realpath($filePath));
$data = array("media" => $real_path, 'form-data[filename]' => $filePath, 'form-data[content-type]' => $mime);
$data = array("media" => $real_path, 'form-data[filename]' => $filePath, 'form-data[Content-Type]' => $mime);
if ($isPermanent && $mime == 'video/mp3') {
$data = ['media' => $real_path, 'description[title]' => $title, 'description[introduction]' => $introduction];
}
+1 -1
View File
@@ -146,7 +146,7 @@ class PublicTemplate extends SmallProgram
$params = json_encode($default, JSON_UNESCAPED_UNICODE);
$this->request->setIsSSL(true);
$this->request->addHeader('content-type', 'application/json');
$this->request->addHeader('Content-Type', 'application/json');
$this->request->setErrorField('errcode');
$this->request->setErrorMsgField('errmsg');
$result = $this->request->post($url, $default);