4
I need to provide in my web api three forms of query: First Get with all "Getall" records, the second GET by id and a third GET with ribbon options, sent by client, e.g.: Name contains the letter "a" and address contains the word "bridge", I thought to send by queryString, but does not hit the correct action, incomplete example of how I thought to do the Get of filtered:
public HttpResponseMessage GetFiltrados() {
string condicao = "";
string[] filtros = Request.RequestUri.Query.Substring(1).Split('&');
foreach (var filtro in filtros) {
condicao += "";
}
if (reg != null) {
return Request.CreateResponse(HttpStatusCode.OK, reg);
} else {
return Request.CreateResponse(HttpStatusCode.NotFound, "Registro não encontrado");
}
}
How do I create these three Get methods? I’m doing it right with Get with filters for REST default?
Ps.: My POST I did on the default, all in JSON, but GET didn’t know how to fix the ribbon.
Your question is not clear, you already have 2 Get’s and would like to do one more?
– DiegoAugusto
I edited the question, see if it got better
– João Paulo