I have following asp.net web api on my serverside which is supposed to take either phone number or email address as user login name.It works perfectly fine with email address and phone number without having '+' prefixed to it.When phone number has + this api never gets hit.
Class level routeprefix: [RoutePrefix("api/Account")]
[HttpPost]
[HttpOptions]
[Route("{UserName}/ResetCode")]
public IHttpActionResult ResetCode([FromUri]string userName, [FromUri]string lan = null)
{
service.ResetCode(userName, language);
return Ok();
}
Fiddler request: with + in phone number:
http://localhost:56771/api/Account/%2B18888888888/ResetCode?lan=en-US
This does not hit my api.
Fiddler request without +:
http://localhost:56771/api/Account/18888888888/ResetCode?lan=en-US
This Url hits the service.
Fiddler request with email:
http://localhost:56771/api/Account/abc%40GMAIL.COM/ResetCode?lan=en-US
This Url hits the service.
What could be the reason for first url(listed above) is unable to hit the service.
Thanks for your help.