php 用post请求调用接口api
$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);