博客


简单用CURL方式调试金蝶云星辰接口


采用CURL方式post数据到金蝶云星辰接口并取到返回数据到layui的数据表格中
			$url='http://api.kingdee.com/jdy/sal/sal_outbound_list?access_token=1613533445ca5dbeebca668abbeb58ac';
			$data = '{"page":'.$page.', "pagesize":10}';
			$headerArray =array("Content-type:application/json;","groupName:ns-v7g6","accountId:1584244570835057173");
			$ch = curl_init();
			curl_setopt($ch, CURLOPT_URL, $url);
			curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
			curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
			curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
			curl_setopt($ch, CURLOPT_HTTPHEADER,$headerArray);
			curl_setopt($ch, CURLOPT_POST, 1);
			curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
			$output = curl_exec($ch);
			curl_close($ch);
			//return json($output);
			//die;
			$res = json_decode($output, true);
			$c['code']=0;
			$c['msg']="";
			$c['count']=$res['data']['count'];
			$c['data']=$res['data']['rows'];
			return json($c);



上一篇:没有了

下一篇:没有了