Guy is not recommended you use Javascript for data transport, it is very explicit and is something very dangerous, if you are working with important data that can put at risk financial loss or even loss of something, I recommend using PHP much safer.
But so for you to do a GET
You can use both getJSON(Jquery) AJAX(Jquery)
function recViaCep(){
$.ajax({
url: "https://viacep.com.br/ws/"+ $("#cep").val()+"/json/",
type: "GET",
dataType: 'json',
success: function(response){
dados = response;
$('#logradouro').val(dados.logradouro.toUpperCase());
$('#bairro').val(dados.bairro.toUpperCase());
$('#cidade').val(dados.localidade.toUpperCase());
$('#estado').val(dados.uf.toUpperCase());
initMap();
$("#nomeRegristro").val($("#CNPJCPF").val() + " - " + $("#nomeAnalista").val())
}
});
}
In this example I am requesting a JSON by AJAX, which for proper purposes will not put at risk my company, so see what you need to do!!
$.getJSON("demo_ajax_json.js", function(result){
$.each(result, function(i, field){
$("div").append(field + " ");
});
});
Already here is an example of request by JSON
As I said, be careful with the post method, the JS will not leave your data safe