更新兼容性
This commit is contained in:
parent
8a7a27fccd
commit
88e9097b53
|
@ -337,7 +337,12 @@ function curl_post($url,$data,$headers=[]) {
|
|||
//设置为post方式请求
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
//添加参数
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
|
||||
if (is_array($data)) {
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
|
||||
}
|
||||
if (is_string($data)) {
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
||||
}
|
||||
//设置header
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
//关闭请求资源
|
||||
|
|
Loading…
Reference in New Issue