public static function curlPost($url, $data=array()) {
$ch = curl_init();
if (is_array($data) && $data) {
$formdata = http_build_query($data);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $formdata);
}
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT,0);
$result = curl_exec($ch);
return $result;
}
相关文章
- 08-03[命令行] curl查询公网出口IP
- 08-03php – SQLSTATE [HY000] [2002]连接在Laravel宅基地内被拒绝
- 08-03用代理服务加快brew下载速度。方法:curl
- 08-03CFD POST流线图设置
- 08-03使用curl+openssl实现单项身份验证
- 08-03libcurl http post文件同时接收服务器响应文件
- 08-03通过curl命令访问K8s API
- 08-03我可以在PHP的多核LAMP机器上调用多个FFMPEG进程吗?
- 08-03error: RPC failed; curl 18 transfer closed with outstanding read data remaining
- 08-03通过curl以及ping命令批量测试主机连通性