|
@@ -243,7 +243,7 @@ if(!function_exists("headerSign")){
|
|
|
$value =array_merge($post,$headerArr);
|
|
|
$Sign= new \Sign($appid,$appkey);
|
|
|
$headerArr['sign'] = $Sign->makeSign($value);
|
|
|
- $list=[];
|
|
|
+ $list=["Content-Type"=>"multipart/json;charset=utf-8"];
|
|
|
foreach ($headerArr as $key=>$value){
|
|
|
$list[]=$key.":".$value;
|
|
|
}
|
|
@@ -252,11 +252,11 @@ if(!function_exists("headerSign")){
|
|
|
}
|
|
|
|
|
|
//参数1:访问的URL,参数2:post数据(不填则为GET),参数3:提交的$cookies,参数4:是否返回$cookies
|
|
|
-function curl_request($url,$post='',$header=["Content-Type: multipart/json;charset=utf-8"]){
|
|
|
- $header = empty($header) ? '' : $header;
|
|
|
-// $singHead = headerSign($post);
|
|
|
+function curl_request($url,$post='',$header=[]){
|
|
|
+// $header = empty($header) ? '' : $header;
|
|
|
+ $header = headerSign($post);
|
|
|
|
|
|
- if(is_array($post)) $post=json_encode($post,JSON_UNESCAPED_UNICODE);
|
|
|
+ if(is_array($post)) $post=http_build_query($post);
|
|
|
$curl = curl_init();
|
|
|
curl_setopt($curl, CURLOPT_URL, $url);
|
|
|
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)');
|