Пытается проверить API Uber Rush (от локального и от Linux-сервера).Uber Rush API Sandbox
Вызов Токен работает - я получаю маркер пытается реализовать пример SANbox:
curl -X "PUT /v1/sandbox/deliveries/{delivery_id}" \
-H "Authorization: Bearer <OAUTH TOKEN>" \
-d "{\"status\":\"en_route_to_pickup\"}"
с URL https://sandbox-api.uber.com/
и я попробовал тот же запрос с file_get_contents (в PHP)
Так , Я всегда получаю ошибку «405 Метод не допускается»
{"message":"Method not supported for this endpoint.","code":"method_not_allowed"}
Что мне нужно сделать, чтобы получить доступ к методу из этого примера песочницы https://developer.uber.com/docs/rush/sandbox?
синтаксис Corrent
curl -X "PUT" -H "Authorization: Bearer <TOKEN>" -H "Content-Type: application/json" -d "{\"status\":\"en_route_to_pickup\"}" https://sandbox-api.uber.com/v1/sandbox/deliveries/DELIVERY_ID
Каков точный вызов file_get_contents, который вы создаете? –
'$ url = 'https://sandbox-api.uber.com/v1/sandbox/deliveries/ID_HERE'; $ headers = array ('Авторизация: Носитель' .TOKEN_HERE); $ options = array ( 'https' => array ( 'header' => $ headers, ), ); $ context = stream_context_create ($ options); $ result = file_get_contents ($ url, false, $ context); ' –