This commit is contained in:
2021-04-14 16:04:56 +08:00
parent 8c336e7cd5
commit 3139e426d9
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -530,9 +530,9 @@ abstract class ClientAbstracts extends Component implements IClient
/**
* @param $newData
* @return mixed
* @return string
*/
protected function mergeParams($newData): mixed
protected function mergeParams($newData): string
{
if (empty($this->getData())) {
return $this->toRequest($newData);
+2 -3
View File
@@ -54,12 +54,11 @@ class Curl extends ClientAbstracts
return $resource;
}
if ($method === self::GET && !empty($this->getData())) {
if (!empty($this->getData())) {
curl_setopt($resource, CURLOPT_POSTFIELDS, $this->getData());
} else if ($method === self::POST) {
curl_setopt($resource, CURLOPT_POSTFIELDS, $this->mergeParams($params));
}
if ($method === self::UPLOAD) {
} else if ($method === self::UPLOAD) {
curl_setopt($resource, CURLOPT_POSTFIELDS, $params);
}
return $resource;