c# - Webapi 2 Attribute Routing -
i have following routes set in user controller:
[enablecors("*", "*", "*")] [routeprefix("api/users")] [authorize] public class usercontroller : apicontroller { [route("")] public ihttpactionresult get() { } [httpget] [route("{id:int}")] public ihttpactionresult get(int id) } [httppost] [route("validateuser")] public ihttpactionresult validateuser() { } [httppost] [route("verify/{identityid}/{emailaddress}")] public void verifyuseremailaddress(string identityid, string emailaddress) { } }
the first 3 routes work fine. fourth fails 404. i'm using fiddler make call:
http://localhost:39897/api/users/verify/asldkfj/jb@test.com (post selected)
does post require data sent in body? can see i'm doing wrong , why verify route not being found?
the .com
in email issue.
sure valid email, iis treats requests file extensions actual file requests , tries find on disk. when can't find 404 not found
if add trailing slash /
request should work.
ie http://localhost:39897/api/users/verify/asldkfj/jb@test.com/
Comments
Post a Comment