"2ЭС5К", "number"=>"0146А", "subnumber"=>"11374428", "diagnosticCard"=>"e95386f0-9bad-11e9-80d5-005056011052", "rfid"=>"2545856584", "kind"=>"ТР-1", "dateTime" => "1562077752", "sectionId"=>"ac895a1e-f049-11e1-8e8b-001517e6ca10", ]); //код 4452578 //$jsonEncoded = json_encode( // [ // "locomotive_serie" => "2ЭС5К", // "number"=>"0275А", // "subnumber"=>"12025490", // "diagnosticMap"=>"004d9e52-9848-11e9-80d5-005056011052", // "typeOfRepair"=>"ТР-1", // "dateTime" => "1562077752", // "sectionId"=>"34d11b7c-f04a-11e1-8e8b-001517e6ca10", // "PP-5dbc36ea-47e9-472f-ba17-b45422fc25ac"=>array() // ]); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-Type: application/json","Accept: application/json","appKey: " . $key)); curl_setopt($curl, CURLOPT_TIMEOUT, 60); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_POST, 1); curl_setopt($curl, CURLOPT_POSTFIELDS, $jsonEncoded); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); $result = curl_exec($curl); //$info = curl_getinfo($curl, CURLINFO_HEADER_OUT); //$result = json_decode($result,true); echo "
";var_dump($jsonEncoded); echo "
"; curl_close($curl); function milliseconds() { $mt = explode(' ', microtime()); return ((int)$mt[1]) * 1000 + ((int)round($mt[0] * 1000)); } echo "
";var_dump($result); echo "
"; ?>