access_token->getToken()['access_token']; $url = "https://api.weixin.qq.com/wxa/sec/order/upload_shipping_info?access_token=" . $accessToken; $response = Http::withHeaders(['Content-Type' => 'application/json; charset=utf-8'])->withBody(json_encode($data, JSON_UNESCAPED_UNICODE), 'application/json')->post($url); $response->throw(); $result = $response->json(); logger("微信小程序-发货信息录入", $result); $code = data_get($result, "errcode"); if ($code != 0) { throw new BizException("失败: (".$code.")" . data_get($result, "errmsg")); } } }