有些网上接口请求需要用代理

 

php代码

<?php
header('Access-Control-Allow-Origin:*');
$url=$_POST['urlString'];
$res = file_get_contents($url);
echo $res;
?>

 

地址:     http://xzqyun.top/interface/searchmusicheader.php

 

示例代码 

            $.post(
                "http://xzqyun.top/interface/searchmusicheader.php",
                {
                    urlString:'网址'
                },
                function(result){
                    console.log(result);
                }
            );

 

posted on 2018-10-08 15:16  xzqyun  阅读(141)  评论(0编辑  收藏  举报