0
I have an Api that receives the posted data as it shows the image, it turns out the data is coming empty, I appreciate the help.
//http://localhost:49764/api/unidade/carrinho/consultaUnidadeAtendimento
[HttpPost]
[Route("unidade/carrinho/consultaUnidadeAtendimento")]
public HttpResponseMessage ConsultaUnidadeAtendimento(ConsultaUnidadeAtendimentoModel consultaAtendimento)
{
try
{
string numeroCarrinho = consultaAtendimento.NumeroCarrinho.ToString();
string cep = consultaAtendimento.Cep;
bool retiraLocal = consultaAtendimento.RetiraNoLocal;
var tTabela = "";
var listar = "";
return Request.CreateResponse(HttpStatusCode.OK, new { usuario = listar.ToArray() });
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message);
}
}
public class ConsultaUnidadeAtendimentoModel
{
[JsonProperty("numeroCarrinho")]
public long NumeroCarrinho { get; set; }
[JsonProperty("itens")]
public dynamic Itens { get; set; }
[JsonProperty("cep")]
public string Cep { get; set; }
[JsonProperty("retiraNoLocal")]
public bool RetiraNoLocal { get; set; }
}
did same post here with your object and worked normally not changed anything
– Eduardo Sampaio
How is that possible? What can that be? It doesn’t make sense that it works for you and not for me, does it have any configuration that I don’t have?
– Harry
I found the error, Postman set to text
– Harry