0

Yet another one of these questions, but I could not find an answer to why I am getting this error in any of the others.

I have my routes set up as:

public class ContentRoutes { public static void Map(RouteCollection _routes) { _routes.MapHttpRoute( name: "GetThumbnail", routeTemplate: "api/content/thumbnail/{_id}", defaults: new { controller = "Content", id = "GetThumbnail" } ); _routes.MapHttpRoute( name: "GetFile", routeTemplate: "api/content/file/{_id}", defaults: new { controller = "Content", id = "GetFile" } ); } } 

Which I am trying to map to my controller methods, which are declared as:

[AcceptVerbs("GET")] public HttpResponseMessage GetThumbnail(int _id) [AcceptVerbs("GET")] public HttpResponseMessage GetFile(int _id) 

When trying to access either of these, I am getting the error shown in the question title. I must be missing something obvious but I can not put my finger on it. Any ideas?

2
  • 2
    I think it should be like defaults: new { controller = "Content", action = "GetThumbnail" }. action =, not id = Commented Apr 4, 2013 at 14:35
  • holy crap! how did I not see that typo....goodbye time I wasted Commented Apr 4, 2013 at 14:36

1 Answer 1

1

I think it should be like defaults: new { controller = "Content", action = "GetThumbnail" }. action =, not id =

(Just posting as answer so it can be accepted as it satisfies the OP)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.