2
I have a web api with the following method:
[HttpGet]
[Route("api/documento/doc/list?{cpf}")]
public string Listar(string cpf)
{
return "value";
}
I need the above method to be called through the url:
http://localhost:54037/api/document/doc/list? Cpf=53724435886
The big problem is the "?" between the list and Cpf.
How can I change the route to work with the URL above?
The way you suggested I already tested it and unfortunately it does not answer me. This web api is for product integration and needs to have the URL: > http://localhost:54037/api/document/doc/list? Cpf=53724435886 The big question is precisely the list? Cpf.
– Thiago Rodolfo
let your route only so api/document/doc/list , that at the end qnd vc pass url api/document/doc/list? Cpf=53724435886 it will understand
– Jeferson Almeida
Hi Jeferson, unfortunately it didn’t work. Curious is that even the route being [Route("api/document/doc/list")] the url that worked was: api/document/doc/? Cpf=53724435886.
– Thiago Rodolfo