How to get GET parameters with ASP.NET MVC ApiController
asp.net-mvc, asp.net-mvc-4, asp.net-web-api
Solution
You could just use
HttpContext.Current.Request.QueryString
Problem
I feel a bit absurd asking this but I can't find a way to get parameters for a get request at `/api/foo?sort=name` for instance. In the `ApiController` class, I gave a `public string Get()`. Putting `Get(string sort)` makes `/api/foo` a bad request. Request instance in the `ApiController` is of type `System.Net.Http.HttpRequestMessage`. It doesn't have a `QueryString` or `Parameters` property or anything.