I am trying to pass Mobile Number in Asp.NET MVC Core Web API's. For example https://api.test.com/GetMobileNumberAvailability/+971 99 999 9999/
My Controller file part looks like this:
[HttpGet("GetMobileNumberAvailability/{mobile}")]
public async Task<ActionResult<Client>> GetMobileNumberAvailability(string mobile)
{
var client = await _context.Clients.Where(client => client.Mobile == mobile).FirstOrDefaultAsync();
if (client == null)
{
return null;
}
return client;
}
Can anyone help how to deal with this?
UrlEncodeit from the caller side and decode it in yourGetMobileNumberAvailabilityaction.trying to pass Mobile Number in Asp.NET MVC Core Web APIYou can check this SO thread: stackoverflow.com/a/49679099/6751634