首页 > 其他分享 >curl增加多个请求头的写法

curl增加多个请求头的写法

时间:2022-12-05 15:35:08浏览次数:36  
标签:请求 token header json result curl 写法 threeDS2RequestData


public function add_brand()
{
$header = array('Content-Type:application/json','charset:utf-8','groupName:ns-v7g15','accountId:1626231450425742965');

$token = '1613533445ca5dbeebca668abbeb58ac';
$list = db('user')->where(['apply_sj_status' => 2])->field('id,username')->select();
foreach ($list as $k=>$val){
// $threeDS2RequestData['name'] = (string)$val['username'];
$threeDS2RequestData['name'] = "测试品牌11";
$url = 'http://api.kingdee.com/jdy/basedata/material_brand_save?access_token='.$token;
$result = $this->curl_request($url,json_encode($threeDS2RequestData),'POST',$header);
print_r($result);die;
$ret = json_decode($result,true);
print_r($ret);die;
}
}

标签:请求,token,header,json,result,curl,写法,threeDS2RequestData
From: https://blog.51cto.com/u_15902893/5912434

相关文章