A
A
alex995052015-10-20 11:03:20
ASP.NET
alex99505, 2015-10-20 11:03:20

How to set up routing in Web.API?

Now the web config is configured like this:

config.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{request}",
                defaults: new { id = RouteParameter.Optional }
            );

View request
http://localhost:42648/api/values/Table_name(1)?select=Name

handles correctly.
How to make a query like:
http://localhost:42648/api/values/Table_name(1)/field?select=Name

Did everything also come to my GET method with the string request parameter?
Now I'm getting an error about the address does not exist
http://localhost:42648/api/values/Table_name(1)/field?select=Name

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Kovalsky, 2015-10-20
@dmitryKovalskiy

Anything after the question mark has no effect on the route. The problem is most likely that you didn't describe the {controller}/{request}/{something} route.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question