我想在php中发送带有rest api的数组,但我不知道该怎么做
我尝试使用 json 而没有 json 但没有回应我
$drv = array('mobile'=>'+123456', 'title'=>"MR", 'firstName_en'=>'john', 'lastName_en'=>'wilet');
curl_setopt($process, CURLOPT_POSTFIELDS, "checkoutStation=xxx&checkoutDate=20190826&checkoutTime=0900&checkinStation=xxx&checkinDate=20190827&checkinTime=0900&email=info@site.net&driver=$drv");
也试试
$drv = array('mobile'=>'+123456', 'title'=>"MR", 'firstName_en'=>'john', 'lastName_en'=>'wilet');
$drv=json_encode($drv);
curl_setopt($process, CURLOPT_POSTFIELDS, "checkoutStation=xxx&checkoutDate=20190826&checkoutTime=0900&checkinStation=xxx&checkinDate=20190827&checkinTime=0900&email=info@site.net&driver=$drv");
因为驱动程序参数在我运行代码时需要一个数组数据值返回错误":["驱动程序数据错误!"] 给我
慕田峪7331174
一只斗牛犬