能帮我吗,我想将UBER API与GuzzleHttp一起使用
$uber_client = new Client([
'base_uri' => 'https://api.uber.com/v1.2/',
'timeout' => 2.0,
'headers' => [
'content_type' => 'application/json',
'Accept-Language' => 'fr_FR',
'Authorization' => "Bearer $uber_access_token"],
]);
提出乘车要求-估算:
$resp_uber = $uber_client->post("requests/estimate", [
'auth' => [
'Authorization' => "Bearer $uber_access_token"
],
'form_params' => [
'start_latitude' => $start_latitude,
'start_longitude' => $start_longitude,
'end_latitude' => $end_latitude,
'end_longitude' => $end_longitude,
]
]);
=> Erreur:
ErrorException(E_NOTICE) 未定义的偏移量:0