I have a problem with calling a HttpGet method with parameters. I am working in .Net Framework 4.7.2. I am using Advanced REST Client to test my methods.
When I call a method with no parameters, it works just fine, but when I want to call a method with parameters I am not able to. Where is the mistake I am making?
Here are my 2 methods.
[HttpGet]
[Route("action1")]
public IHttpActionResult action1()
{
return Ok("blabla");
}
[HttpGet]
[Route("action2/{parameter}")]
public IHttpActionResult action2(string parameter)
{
return Ok(parameter);
}
And here is how I call the second method. As I said, the first one works just fine.
Here is the message I keep getting:{ "Message": "No HTTP resource was found that matches the request URI 'https://localhost:44338/api/login/action2/?parameter="blabla"'.", "MessageDetail": "No action was found on the controller 'Login' that matches the request." }
question from:
https://stackoverflow.com/questions/65935628/cannot-call-httpget-method-with-parameters-in-c-sharp-net-framework 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…