未定义的偏移量:0,带有LARAVEL 5.6和GuzzleHttp POST请求

时间:2018-07-09 16:46:38

标签: guzzle laravel-5.6 uber-api

能帮我吗,我想将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

0 个答案:

没有答案