当我们致电Uber Products API
时,其工作正常,但当我们致电Ride Reminder API
时,我们会收到404错误:
PHP致命错误:未捕获异常GuzzleHttp \ Exception \ ClientException
带有消息
导致404 Not Found响应:
未找到404页面 /var/www/html/uber/uber/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php:113 堆栈跟踪: #0 /var/www/html/uber/uber/vendor/guzzlehttp/guzzle/src/Middleware.php(65): GuzzleHttp \异常\ RequestException ::创建(对象(GuzzleHttp \ PSR7 \请求), 对象(GuzzleHttp \ PSR7 \响应)) #1 /var/www/html/uber/uber/vendor/guzzlehttp/promises/src/Promise.php(203): GuzzleHttp \中间件:: GuzzleHttp {闭合}(对象(GuzzleHttp \ PSR7 \响应)) #2 /var/www/html/uber/uber/vendor/guzzlehttp/promises/src/Promise.php(156): GuzzleHttp \无极\无极:: callHandler(1, 对象(GuzzleHttp \ Psr7 \ Response),数组) #3 /var/www/html/uber/uber/vendor/guzzlehttp/promises/src/TaskQueue.php(47): GuzzleHttp \无极\无极:: GuzzleHttp \ {承诺关闭}() #4 /var/www/html/uber/uber/vendor/guzzlehttp/promises/src/Promise.php(246): Guzzle in /var/www/html/uber/uber/vendor/stevenmaguire/uber-php/src/Client.php 在第173行
我们正在使用以下示例代码来解决,让我知道可能会出现什么问题。
<?php
include "vendor/autoload.php";
$client = new Stevenmaguire\Uber\Client(array(
'access_token' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'server_token' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
'use_sandbox' => true, // optional, default false
'version' => 'v1.2', // optional, default 'v1.2'
'locale' => 'en_US', // optional, default 'en_US'
));
$products = $client->getProducts(array(
'latitude' => '41.85582993',
'longitude' => '-87.62730337'
));
var_dump($products);
$attributes = array(
'reminder_time' => '1429294463',
'phone_number' => '555-555-5555',
'event' => array(
'time' => '1515750429',
'name' => 'John with friends',
'location' => 'Dolores Park',
'latitude' => '37.759773',
'longitude' => '-122.427063',
'product_id' => "737d4e43-9e12-4a81-add3-acb101bab4c7",
),
);
$reminder = $client->createReminder($attributes);
var_dump($reminder);
请帮助我们解决此问题。