ecstore 调用openapi
2021-05-04 15:31
标签:array his core als 调用 tor pcl kernel url ecstore 调用openapi 标签:array his core als 调用 tor pcl kernel url 原文地址:http://www.cnblogs.com/limonyun/p/7700435.html//小技巧:
//1. 在系统中可以直接用工具类base_httpclient 来实现.
//2. openapi的调用api可以用kernel::openapi_url()生成.
$http = new base_httpclient;
$url = kernel::openapi_url(‘openapi.queue‘,‘worker‘,array(‘task_id‘=>$task_id));
$http->post($url,$_POST);
//base_httpclient下面含有curl的方法
function get($url,$headers=null,$callback=null,$ping_only=false){
return $this->netcore->action(__FUNCTION__,$url,$headers,$callback,null,$ping_only);
}
function post($url,$data,$headers=null,$callback=null,$ping_only=false){
return $this->netcore->action(__FUNCTION__,$url,$headers,$callback,$data,$ping_only);
}