'130960054_int','clave' => '130960054','rnc' => '130960054'); //Se convierte en formato json $payload = json_encode($data); // Opciones headers curl_setopt($ch, CURLOPT_POSTFIELDS, $payload); // Set contenido json en Body curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type:application/json')); // Retornar inmediatamente respueta curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // Se ejecuta el PST $result = curl_exec($ch); $result2=json_decode($result); //Imprimimos resultado //print($result); echo "Los datos recibidos son los siguientes: "; echo "
"; foreach($result2 as $resul){ echo "
"; echo $resul; echo "
"; } // Se cierra el recurso curl_close($ch); ?>