I have a method within a controller that returns a list of objects. The implementation of the controller is not important. The method is called GetAllTestsByLocationIdAndPollTypeId and returns a list of 'Test' objects. The GET takes 4 parameters, a locationId, pollTypeId, itemsToLoad and a string to search by. I am looking to add more parameters and feel that passing in 6 objects in a url is a bit much. The method signature looks like this:
[HttpGet]
public IHttpActionResult GetAllTestsByLocationIdAndPollTypeId(int locationId, int pollTypeId, int itemsToLoad = 8, string search = "")
Should I pass in a model that contains the values I am currently using for parameters?
EDIT: I can't do a [HttpPost] because POST requests do not get cached and therefore can be expensive and in this case, will be expensive.
EDIT: I solved the filters in the query string using optional parameters to reduce the number of things being passed in.