< ? php $data = array( "token" => "707f124f94419b2b62529615648094e2-calcular", "codCliente" => "89f03f7d02720160f1b04cf5b27f5ccb", "pontos" => array( array( "rua" => "Av. das Palmeiras", "numero" => "291", "complemento" => "", "bairro" => " Duque de Caxias", "cidade" => "Betim", "uf" => "MG", "la" => "-19.936811", "lo" => " -44.160655", "cep" => "32673-302" ), array( "rua" => "R. Angola", "numero" => "", "complemento" => "", "bairro" => "Novo Horizonte", "cidade" => "Betim", "uf" => "MG", "la" => "-19.941547", "lo" => "-44.200964", "cep" => "32606-174" ), array( "rua" => "R. Inspetor Jaime Caldeira", "numero" => "513", "complemento" => "", "bairro" => "Brasiléia", "cidade" => "Betim", "uf" => "MG", "la" => "-19.972064", "lo" => "-44.203008", "cep" => "32600-286" ), array( "rua" => "R. Manoel Macedo", "numero" => "147", "complemento" => "", "bairro" => "Londrina", "cidade" => "Santa Luzia", "uf" => "MG", "la" => "-19.797236", "lo" => "-43.924910", "cep" => "33115-580" ) ), "retorno" => "S", "DataRetirada" => "2022-05-02 19:30:00", "tipoCalculo" => "" ); $url = 'http://mototaxionline.com/integracao'; $content = json_encode($data); $curl = curl_init($url); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_HEADER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $content); curl_setopt($curl, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($content)) ); $json_response = curl_exec($curl); $status = curl_getinfo($curl, CURLINFO_HTTP_CODE); if ($status == 200) { echo "Retorno: " . $json_response; }else{ die("Error: call to URL $url failed with status $status, response $json_response, curl_error " . curl_error($curl) . ", curl_errno " . curl_errno($curl)); } curl_close($curl); ?>