改名
This commit is contained in:
@@ -530,9 +530,9 @@ abstract class ClientAbstracts extends Component implements IClient
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $newData
|
* @param $newData
|
||||||
* @return mixed
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function mergeParams($newData): mixed
|
protected function mergeParams($newData): string
|
||||||
{
|
{
|
||||||
if (empty($this->getData())) {
|
if (empty($this->getData())) {
|
||||||
return $this->toRequest($newData);
|
return $this->toRequest($newData);
|
||||||
|
|||||||
@@ -54,12 +54,11 @@ class Curl extends ClientAbstracts
|
|||||||
return $resource;
|
return $resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($method === self::GET && !empty($this->getData())) {
|
if (!empty($this->getData())) {
|
||||||
curl_setopt($resource, CURLOPT_POSTFIELDS, $this->getData());
|
curl_setopt($resource, CURLOPT_POSTFIELDS, $this->getData());
|
||||||
} else if ($method === self::POST) {
|
} else if ($method === self::POST) {
|
||||||
curl_setopt($resource, CURLOPT_POSTFIELDS, $this->mergeParams($params));
|
curl_setopt($resource, CURLOPT_POSTFIELDS, $this->mergeParams($params));
|
||||||
}
|
} else if ($method === self::UPLOAD) {
|
||||||
if ($method === self::UPLOAD) {
|
|
||||||
curl_setopt($resource, CURLOPT_POSTFIELDS, $params);
|
curl_setopt($resource, CURLOPT_POSTFIELDS, $params);
|
||||||
}
|
}
|
||||||
return $resource;
|
return $resource;
|
||||||
|
|||||||
Reference in New Issue
Block a user