vs6262
Silver Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору выдает: { "error": { "errors": [ { "domain": "global", "reason": "badRequest", "message": "Invalid inputs for request id \"rXFVwV6dTEsu1c0r00M7iI\": QPX Warning. Latest departure time (2015-05-09T22:59 UTC) is in the past or is incompatible with the prior slice arrival time and the requested minimum travel time." } ], "code": 400, "message": "Invalid inputs for request id \"rXFVwV6dTEsu1c0r00M7iI\": QPX Warning. Latest departure time (2015-05-09T22:59 UTC) is in the past or is incompatible with the prior slice arrival time and the requested minimum travel time." } } 1 PHP: Код: <?php $data = array ( "request" => array( "passengers" => array( adultCount => 1 ), "slice" => array( array( origin => "LIS", destination => "OPO", date => "2015-05-09"), ), solutions => "1" ), ); $data_string = json_encode($data);$ch = curl_init('https://www.googleapis.com/qpxExpress/v1/trips/search?key=My-API-Key'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); $result = curl_exec($ch);curl_close($ch); /* then I echo the result for testing purposes */ echo $result; ?> | |