<?php
header('Content-Type: text/plain; charset=utf-8');

$placa = "PQA4703";
$fingerprint = "t9vF262pEP0uG0oFnk5q";
$terminal = "4068707027";

// Configurações do Proxy NodeMaven
$proxy = "gate.nodemaven.com:8080";
$proxyAuth = "pkscabelim_gmail_com-country-br-ipv4-true:xcy2s9jsob";

$url = "https://nfbti53lkd.execute-api.us-east-2.amazonaws.com/dev/site/vehicle/{$placa}?plate={$placa}&email=rickcooder@gmail.com&phone=62996494518&uf=GO&fingerprintId={$fingerprint}";

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "terminal: {$terminal}",
    "x-fingerprint-site-id: {$fingerprint}",
    "user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36",
    "origin: https://www.zignet.com.br",
    "referer: https://www.zignet.com.br/",
    "accept: application/json, text/plain, */*"
]);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, true); // CAPTURAR HEADERS
curl_setopt($ch, CURLOPT_PROXY, $proxy);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyAuth);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 20);

$response = curl_exec($ch);
$headerSize = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
$headers = substr($response, 0, $headerSize);
$body = substr($response, $headerSize);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

echo "HTTP STATUS: $httpCode

";
echo "--- HEADERS RETORNADOS ---
";
echo $headers . "
";
echo "--- CORPO DA RESPOSTA ---
";
echo $body . "
";
