//测试接口
public function testapi(){
$pwd = 'Pass1234';
$uid = 'test01';
//获取token
$token = $this->getToken(); //我自己的另外的方法
//获取加密后的密文
$credential = $this->publicEncrypt($pwd);//我自己的另外的方法
//自定义的header数据
$header=array('Content-Type:application/json','Authorization:Bearer '.$token['token'],);
//请求地址
$sUrl = 'https://测试url';
//post数据
$aData = array(
'uid' => $uid,
'credential' => $credential,
);
$sResult = $this->httpRequest($sUrl,$header,$aData);
$aResData = json_decode($sResult, true);
php curl 请求携带header参数
最新推荐文章于 2025-02-27 09:52:37 发布