Browse Source

优化Http多维数组参数传递

Karson 1 year ago
parent
commit
a5e1fe9cb6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      extend/fast/Http.php

+ 1 - 1
extend/fast/Http.php

@@ -60,7 +60,7 @@ class Http
             } else {
                 $defaults[CURLOPT_CUSTOMREQUEST] = $method;
             }
-            $defaults[CURLOPT_POSTFIELDS] = $params;
+            $defaults[CURLOPT_POSTFIELDS] = is_array($params) && count(array_filter($params, 'is_array')) > 0 ? $query_string : $params;
         }
 
         $defaults[CURLOPT_HEADER] = false;