WebApi method with email address parameter returns 404 from HttpClient

前端 未结 4 1445
盖世英雄少女心
盖世英雄少女心 2021-01-01 10:32

I have a WebApi controller with a method that looks like such:

[HttpGet]
[AcceptVerbs(\"GET\")]
public HttpResponseMessage Run(string reportName, int someId,         


        
4条回答
  •  情深已故
    2021-01-01 11:21

    You need a basic URL query.

    [Route("api/emails")]
    public HttpResponseMessage Run(string email) {...}
    
    GET api/emails?email=user@domain.com
    

提交回复
热议问题