express怎么post请求php接口
发布网友
发布时间:2022-04-19 14:22
我来回答
共1个回答
热心网友
时间:2023-06-21 18:31
$post_data="";
$ch = curl_init();
$url = '';
curl_setopt($ch , CURLOPT_URL , $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_HEADER, false);
$res = curl_exec($ch);
curl_close($ch);