Reputation: 14108
Goal:
The url should be "https://localhost:44353/api/Authentication/Validate?a=aa&b=bb"
Problem:
What syntax code am I missing in relation to web api?
Thank you!
// https://localhost:44353/api/Authentication/Validate/c/c
[HttpGet("Validate/{a}/{b}")]
public bool Validate(string a, string b)
{
return false;
}
Upvotes: 0
Views: 58
Reputation: 486
Query parameters don't need to be specified in the route pattern. The following should be enough to achieve the goal URL:
[HttpGet("Validate")]
public IActionResult Validate(string a, string b)
{
return Ok(false);
}
Upvotes: 2