|
这里以获取QQ群成员列表为例
复制好请求头后替换下面的header部分即可 //获取QQ群信息接口 public function http_qun(Request $request) { $qun = $request->get('qun'); $header = [ 'POST /cgi-bin/qun_mgr/search_group_members HTTP/1.1', 'Host: qun.qq.com', 'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0', 'Accept: application/json, text/javascript, */*; q=0.01', 'Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2', 'Referer: https://qun.qq.com/member.html', 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8', 'X-Requested-With: XMLHttpRequest', 'Connection: keep-alive', 'Cookie: pgv_pvi=2905580544; pgv_si=s4999177216; _qpsvr_localtk=0.22571974850437893; uin=o0543619552; skey=@iiKTNEvwf; ptisp=ctc; RK=kFZM+zyodd; ptcz=2228eb23d00b580b74fa6d714485d46a0b89a8f594350821154601fb40367485; p_uin=o0543619552; pt4_token=Lp33K43hB71RYpeRr0OwL48IyM4heA5AcYk4xkU*3v4_; p_skey=5r7s*3X9a7DBCgbd3YTasvDWSpGMvAMOYvNEoX-ZoLU_', ]; $json = $this->Header_Http('https://qun.qq.com/cgi-bin/qun_mgr/search_group_members', $header, ['gc' => $qun, 'st' => '0', 'end' => '-1', 'bkn' => '1028212156']); echo $json; }头部请求方法 function Header_Http($url, $header, $post) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 0); //请求头 curl_setopt($ch, CURLOPT_HTTPHEADER, $header); //POST参数 curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($post)); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); //不验证证书 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); //不验证证书 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); $res = curl_exec($ch); return $res; }最后访问接口地址,数据就出来了
8 ^4 N; _6 L; B; {% S |
评分
-
查看全部评分
|