Accessing the query string in ASP.Net Web Api?
Even though @Kiran Challa’s answer is correct, there are few situations that you might prefer to get URL parameters directly from the URL. in those scenarios, try this: using System.Net.Http; var allUrlKeyValues = ControllerContext.Request.GetQueryNameValuePairs(); string p1Val = allUrlKeyValues.LastOrDefault(x => x.Key == “p1”).Value; string p2Val = allUrlKeyValues.LastOrDefault(x => x.Key == “p2”).Value; string p3Val = allUrlKeyValues.LastOrDefault(x => … Read more