This commit is contained in:
2020-11-18 14:41:32 +08:00
parent 9880eeed40
commit 1cf5060217
2 changed files with 12 additions and 5 deletions
+4
View File
@@ -40,6 +40,8 @@ class Curl extends ClientAbstracts
{
[$host, $isHttps, $path] = $this->matchHost($path);
$host = $isHttps ? 'https://' . $host : 'http://' . $host;
$resource = $this->do(curl_init($host . $path), $host . $path, $method);
if ($method === self::POST && !empty($params)) {
curl_setopt($resource, CURLOPT_POSTFIELDS, HttpParse::parse($params));
@@ -64,6 +66,8 @@ class Curl extends ClientAbstracts
{
[$host, $isHttps, $path] = $this->matchHost($path);
$host = $isHttps ? 'https://' . $host : 'http://' . $host;
$resource = $this->do(curl_init($host . $path), $host . $path, self::POST);
curl_setopt($resource, CURLOPT_POSTFIELDS, $params);