Q:

Same parameters,different methods

I'm making an API in asp mvc 4.
I have 2 methods, GetAllBooks() and GetPopularBooks().
To get all books, I call localhost:xxxxx/api/books/, and I get the correct result.
How can I query the popular books? Both methods are parameterless and our info here is not really helpful.
All help is appreciated!

A:

Although this could be achieved using "Routing by Action Name" http://www.asp.net/web-api/overview/web-api-routing-and-actions/routing-in-aspnet-web-api. I strongly suggest that GetPopularBooks() be treated as GetAllBooks but with a filter of popularity.
e.g. 
public IEnumerable<Books> GetAllBooks([FromUri]bool? IsPopular = null)
{
     if(IsPopular.HasValue)
     { //do something
       //return filtered
     }

     //return all
}

Urls:
http://localhost/api/books
http://localhost/api/books?isPopular=true

