遇到问题post,携带cookie,header问题
cookie时CURLOPT_COOKIEFILE携带不上cookie是cookie文件读取权限问题,换了个路径解决了
header时,$header = ['User-Agent: php test']报错,是php版本太低的问题
ini_set('user_agent','Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; GreenBrowser)');
// $cookie = 'Name=Content;SRCHD=AF=NOFORM;PPLState=1';
// $opts = array('http' => array('header'=> 'Cookie:'.@$cookie.''));
// $context = stream_context_create($opts);
// $contents = file_get_contents('http://qvni.cn/cookie', false, $context);
header('Content-Type:application/json; charset=utf-8');
if(strpos($_SERVER['REQUEST_URI'],'K3CloudServiceInterfaceTest')){
$url = "http://192.168.68.141:80".$_SERVER['REQUEST_URI'];