改名
This commit is contained in:
@@ -98,16 +98,16 @@ class Client extends ClientAbstracts
|
|||||||
*/
|
*/
|
||||||
private function setParams(SwowClient $client, $path, $data): string
|
private function setParams(SwowClient $client, $path, $data): string
|
||||||
{
|
{
|
||||||
|
$content = $this->getData()->getContents();
|
||||||
|
if (!empty($content)) {
|
||||||
|
$client->setData($content);
|
||||||
|
}
|
||||||
if ($this->isGet()) {
|
if ($this->isGet()) {
|
||||||
if (!empty($data)) $path .= '?' . $data;
|
if (!empty($data)) $path .= '?' . $data;
|
||||||
if (!empty($this->getData())) {
|
|
||||||
$client->setData($this->getData());
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
if (!empty($this->getData())) {
|
$data = $this->mergeParams($data);
|
||||||
$client->setData($this->getData());
|
if (!empty($data)) {
|
||||||
} else {
|
$client->setData($data);
|
||||||
$client->setData($this->mergeParams($data));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $path;
|
return $path;
|
||||||
|
|||||||
@@ -55,12 +55,14 @@ class Curl extends ClientAbstracts
|
|||||||
if ($isHttps !== false) {
|
if ($isHttps !== false) {
|
||||||
$this->curlHandlerSslSet($resource);
|
$this->curlHandlerSslSet($resource);
|
||||||
}
|
}
|
||||||
if (empty($params) && empty($this->getData())) {
|
|
||||||
|
$contents = $this->getData()->getContents();
|
||||||
|
if (empty($params) && empty($contents)) {
|
||||||
return $resource;
|
return $resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($this->getData())) {
|
if (!empty($contents)) {
|
||||||
curl_setopt($resource, CURLOPT_POSTFIELDS, $this->getData());
|
curl_setopt($resource, CURLOPT_POSTFIELDS, $contents);
|
||||||
} 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) {
|
} else if ($method === self::UPLOAD) {
|
||||||
|
|||||||
Reference in New Issue
Block a user