Skip to content

Instantly share code, notes, and snippets.

@diogenesjup
Created August 17, 2016 14:44
Show Gist options
  • Select an option

  • Save diogenesjup/b3e5d202f8af17441b7449f61bd53f98 to your computer and use it in GitHub Desktop.

Select an option

Save diogenesjup/b3e5d202f8af17441b7449f61bd53f98 to your computer and use it in GitHub Desktop.
<?php
$Nome = "Teste 100";
$Cep = "06327290";
$Cpf = "11111";
$Email = "teste100@teste100.com.br";
$Senha = "11111";
$Estado = "São Paulo";
$Cidade = "São Pauolo";
$TelefoneFixo = "00000000";
$TelefoneCelular = "00000000";
$Endereco = "N/A";
$CidadeId = 1;
$enderecoNome = "N/A";
$Numero = "N/A";
$Complemento = "N/A";
$Bairro = "N/A";
$postdata = http_build_query(
array(
'nome' => $Nome,
'cpf' => $Cpf,
'email' => $Email,
'senha' => $Senha,
'endereco' => array('CidadeId' => $CidadeId, 'Nome' => $enderecoNome, 'Numero' => $Numero, 'Complemento' => $Complemento, 'Bairro' => $Bairro, 'Cep' => $Cep, 'Latitude' => $Latitude, 'Longitude' => $Longitude )
)
);
$opts = array('http' =>
array(
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $postdata
)
);
$context = stream_context_create($opts);
$result = file_get_contents('http://api.csprofissionais.com.br/api/cliente/inserir', false, $context);
$json_str = json_decode($result, true);
print_r($json_str);
echo "<br>fim execução";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment