Tagged Questions
0
votes
1answer
40 views
ASP.NET MVC 4 Web API fails to map path containing the string “con”?
What is so wrong about the string "con"?
OK, my api route configuration is rather uninteresting:
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{id}",
...
2
votes
1answer
50 views
Multiple entity types using the same endpoint/controller
I'm using RavenDB in my application and by default the id to a document looks something like this:
homes/1
where homes is the collection type name of the class Home. If I create a new class called ...
0
votes
2answers
50 views
jQuery ajax - call various MVC controller actions
I have a controller (RequestsController) with several actions (all taking one parameter)
For example:
public List<Models.AcceptRequests> GetAllAcceptRequests(int passedId)
public ...
0
votes
1answer
80 views
How to create Ror style Restful routing in Asp.net MVC Web Api
How to configure routing in asp.net web api, to that I can code for the following actions in my ApiController inherited class?
...
1
vote
1answer
57 views
webapi how to route help page to home page
I have an ASP.NET-Web-API project with a generated help area. I would like to route the home page to be pointing to the help page. How can this be done?
I've tried to modify the area registration like ...
1
vote
1answer
64 views
Iteration Through Routes Mapped to RouteTable.Routes via MapHttpRoute - MVC4 Web API
I have mapped a multitude of routes to my MVC4 project as follows:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
...
1
vote
1answer
76 views
Can I route a mix of optional and conditionally mandatory parameters in ASP.NET Web Api/MVC
I'm guessing that the answer is to make multiple routes, but our route list is beginning to get long, so I'm looking to see if this can be expressed more elegantly and simply. :)
In my current ...
1
vote
1answer
88 views
Web Api route not found
I have already researched many of the questions regarding this topic. I'm no slouch when it comes to MVC3 but for the life of me I can't figure out why my Web Api in MVC 4 routing is failing.
...
0
votes
4answers
163 views
ASP.NET MVC/WebAPI Routing actions
The goal is to allow these four endpoints:
POST v1/invoices
POST v1/invoices/12345
POST v1/invoices/12345/attachment
POST v1/invoices/12345/image
Routing entries:
routes.MapHttpRoute(
...
1
vote
1answer
210 views
setting custom path in routeconfig.cs in mvc 4
Below is my routeconfig.cs file in mvc4 application
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
...
1
vote
2answers
60 views
How to configure routes to have default Get and named Get method in WebApiConfig?
I want to create the following API:
/api/verifications/1
/api/verifications/getfoo/1
Controller methods:
public string Get(int id)
{
return "value";
}
public string ...
0
votes
1answer
111 views
How to access the current HttpRequestMessage object globally?
I have a method which creates an HttpResponseMessage containing an Error object which will be returned based on the current request media type formatter.
Currently, I have hardcoded the ...
1
vote
1answer
62 views
How to know when Web API Routing Engine Doesn't Find a Matching Service?
I'd like to log the requests to my Web API application that results in 404 (which means the routing engine couldn't find a matching service).
How would that be possible?
For example, if I have the ...
2
votes
2answers
78 views
Is there a way to tell routing that my default action name is equal to the HTTP Action Verb?
I've looked through this document on MSDN and can't come up with the answer.
Considering that I have a route defined like this:
config.Routes.MapHttpRoute(
name: ...
0
votes
1answer
126 views
Web api project routing trouble
I have simple web api project (ASP.NET MVC). I need to deploy my project in the sub folder on the IIS. For example: I have site http://TestSite/ and I need to deploy the project to ...