aiyou 4 years ago
parent
commit
a4aa6c9848
1 changed files with 4 additions and 1 deletions
  1. 4 1
      application/api/common.php

+ 4 - 1
application/api/common.php

@@ -31,7 +31,10 @@ function http_curl($url, $type = 'get', $res = 'json', $arr = '')
     curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //不验证证书
     curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //不验证证书
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
-
+    if ($type == 'post') {
+        curl_setopt($ch, CURLOPT_POST, 1);
+        curl_setopt($ch, CURLOPT_POSTFIELDS, $arr);
+    }
     //3.采集
     $output = curl_exec($ch);
     //4.关闭