微信域名检测接口

微信H5链接,被别人恶意举报,导致链接地址被微信屏蔽访问不了,向微信申请解封的时候,却不予通过。这时候需要一个微信上域名封禁状态检测的api,通过api检测结果让域名系统进行轮换。

接口文档地址

接口测试

public function test()
{
        $url = "https://api.xiaoleng.top/check/mpCheckDomain";
        $domain = "https://www.xiaoleng.top";
        $res = $this->checkPost($url,['appKey' => "XXXXXXXXXXXXX",'url' => $domain]);
        dump(json_decode($res,true));
}
public function checkPost($url,$params = [])
{
       $opts = [
            CURLOPT_TIMEOUT        => 30,
            CURLOPT_CONNECTTIMEOUT => 60,
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_SSL_VERIFYPEER => false,
            CURLOPT_SSL_VERIFYHOST => false,
            CURLOPT_HTTPHEADER => ["Content-Type: application/x-www-form-urlencoded"],
            CURLOPT_URL => $url,
            CURLOPT_POST => 1,
            CURLOPT_POSTFIELDS => http_build_query($params),
        ];
        /* 初始化并执行curl请求 */
        $ch = curl_init();
        curl_setopt_array($ch, $opts);
        $data  = curl_exec($ch);
        //$error = curl_error($ch);
        curl_close($ch);
        return  $data;
}

 

posted @ 2021-01-15 19:34  痞子鱼  阅读(243)  评论(0编辑  收藏  举报