Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
//EndPoint: /api/values
//Verbo Http: Post
//O header Content-Type deve ser application/json
//Servidor precisa receber assim.
{ "DataHora": "5/16/2018 5:04:20 PM", "Precipitacao": "15.5" }
//Você como desenvolvedor deve montar e enviar o payload assim.
//Onde esta {NomeAqui}, substitua pela variavel, sem as chaves, dentro dos parentes.
string payloadJson = "{ \"DataHora\": " + "\"" + DataHora + "\"" + ", \"Precipitacao\": " + "\"" + Precipitacao + "\" }";
Ex:
//Variaveis
string DataHora = "5/16/2018 5:04:20 PM";
string Precipitacao = "15.5";
//Payload montado
string payloadJson = "{ \"DataHora\": " + "\"" + DataHora + "\"" + ", \"Precipitacao\": " + "\"" + Precipitacao + "\" }";
//Return
{
"dataHora": "2018-05-16T17:04:20",
"precipitacao": "15.5"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment