I have the following situation, I need to create an API that will receive the content below:
{
"numeroCarrinho": 122865,
"itens": {
"PA00058": 1,
"MA00068": 1,
"PA00004": 1
},
"cep": "41706670",
"retiraNoLocal": false
}
Example: localhost: 7630 / api / drive / query / cart / 122865 / PA00058: 1, MA00068: 1, PA00004: 1/41706670 / false
The problem is that the items would be dynamic, an array of items, how could I do that, I did an example more like to know how I can get all the separate items.
[HttpGet]
[Route("unidade/consulta/carrinho/{numerocarrinho}/{itens}/{cep}/{retiralocal}")]
public HttpResponseMessage ConsultaUnidadeAtendimento(string numerocarrinho, string[] itens, string cep, string retiralocal)
{
try
{
var tTabela = "";
var listar = "";
return Request.CreateResponse(HttpStatusCode.OK, new { usuario = listar.ToArray() });
}
catch (Exception ex)
{
return Request.CreateResponse(HttpStatusCode.BadRequest, ex.Message);
}
}