liufumingren e8605149c0 初始化
2026-08-06 17:04:35 +08:00

20 lines
621 B
PHP

<?php
namespace app\index\library\zopsdk;
class ZopHttpUtil
{
public function post($url, $headers, $querystring, $timeout)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);//设置链接
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//设置是否返回信息
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);//设置HTTP头
curl_setopt($ch, CURLOPT_POST, 1);//设置为POST方式
curl_setopt($ch, CURLOPT_TIMEOUT_MS, $timeout);
curl_setopt($ch, CURLOPT_POSTFIELDS, $querystring);
$response = curl_exec($ch);
return $response;
}
}