<?php
/*
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://scw.pjn.gov.ar/scw/home.seam",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
  'X-DevTools-Request-Id:12884.2587',
  'Origin:http://scw.pjn.gov.ar',
  'X-DevTools-Emulate-Network-Conditions-Client-Id:a347f26b-b7ca-436d-b089-2845ea270a94',
  'Upgrade-Insecure-Requests:1',
  'User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36',
  'Content-Type:application/x-www-form-urlencoded',
  'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/**//*;q=0.8',
  'Referer:http://scw.pjn.gov.ar/scw/home.seam?cid=389481',
  'Accept-Encoding:gzip, deflate',
  'Accept-Language:es-ES,es;q=0.8',
  'X_FORWARDED_FOR:200.41.224.3',
  'Cookie:JSESSIONID=-moliB9v7PdjYJOWYLEawnxU.undefined; _ga=GA1.3.1655826724.1498226110; _gid=GA1.3.543745059.1500309622; _gat=1',
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);
$response = str_replace('/scw/javax.faces.resource/', 'http://scw.pjn.gov.ar/scw/javax.faces.resource/', $response);
$response = str_replace('/scw/seam', 'http://scw.pjn.gov.ar/scw/seam', $response);
$response = str_replace('/scw/home.seam', 'http://scw.pjn.gov.ar/scw/home.seam', $response);
$response = str_replace('http://scw.pjn.gov.ar/scw/home.seam', 'http://192.168.121.7/test2.php', $response);
$response = str_replace('http://scw.pjn.gov.ar/scw/javax.faces.resource/font-awesome.css.seam?ln=css/font-awesome-4.2.0/css', 'font.css', $response);
curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
*/
$curl = curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL => "http://www.test.fidelitas.com.ar/api/ic",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "apikey=1F44A3FAA0C15C42&cuit=".$_GET['cuit'],
  //CURLOPT_POSTFIELDS => "apikey=C824D668799B09DD&cuit=".$_GET['cuit'],
  CURLOPT_HTTPHEADER => array(
    "cache-control: no-cache",
    "content-type: application/x-www-form-urlencoded",
    "postman-token: ff09c054-cc24-4c67-35dc-f2f5715ed14e"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
}else{
  echo $response;
}