0
votes

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?

1
I think it should be like defaults: new { controller = "Content", action = "GetThumbnail" }. action =, not id =Conrad Clark
holy crap! how did I not see that typo....goodbye time I wastedThewads

1 Answers

1
votes

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)