0
votes
2answers
58 views

WEB API URL Routing

I want paths like this: localhost:99/client/themes/plain/index.html?shop=mycoolshop to appear as: localhost:99/client/mycoolshop/index.html. I wrote: routes.MapPageRoute( ...
0
votes
2answers
74 views

Setting a default action to a route in Entity Framework Web API

To the default get, post, put and delete methods I added some more getters, some of which are taking parameters. public class AController { // GET api/A [HttpGet] public ...
0
votes
2answers
101 views

Asp.Net Mvc Web Api Routing issue

I use Web Api for list of tales and I want to do this: List GetAllTales() = api/tales/ Tale GetTale(int id) = api/tales/1 List GetAllTalesByCategory(string categoryName) = api/tales/kids Tale ...
0
votes
2answers
108 views

Understanding routes, how do I create two 'identical' routes that can be both GET and POST?

Previously, I had two methods and I labelled one with [WebGet] and one with [WebInvoke(Method = "POST"] when I did a GET or a POST to the URL that I specified, it would always call the correct ...
3
votes
1answer
255 views

BeginRouteForm doesn't work with API routes?

I have a form I'm trying to create with relatively simple code: @using (Ajax.BeginRouteForm("DefaultApi", new { controller = "persons" }, new AjaxOptions {HttpMethod = "post", OnSuccess = ...
2
votes
1answer
386 views

How to get controller name when Web API versioning with routing attribues

I need to get the controller name from my route and this I can do if using standard routing code in WebApiConfig. However, if I am using routing attributes it starts to get a little difficult, ...
2
votes
1answer
74 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 ...
2
votes
1answer
2k views

MVC4 Web API routing conflict

ISSUE We just switched from MVC4 Web API Beta to the RC and we're running into a Multiple actions were found that match the request ... exception in our service. BACKGROUND We have two POST actions ...
1
vote
1answer
126 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 ...
1
vote
1answer
1k views

RouteHandler for HttpConfiguration

I stumbled onto an interesting article about RouteHandlers for ASP.Net MVC's WebAPI: http://techbrij.com/separate-web-api-action-mobile-asp-net-mvc In this article, it shows how the same WebAPI ...
1
vote
1answer
768 views

How can I map these WebApi routes in ASP.NET MVC 4?

I'm mostly using the default WebApi route mapping, as follows: routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: ...
1
vote
1answer
446 views

How to define a single action to handle all http GET requests that come to this controller?

Here is the route definition: routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{*data}", defaults: new { data= RouteParameter.Optional } ...
0
votes
1answer
28 views

How to extract a context from an URL before reaching the route engine in Web API 2 + Attribute Routing?

I'm migrating a web service from pure C# / no framework to Web API 2. This web service exposes Movies objects (with properties like title, actors, plot...) and these movies objects contains ...
0
votes
1answer
34 views

Why does my action method with default parameters cause a 404?

I've got a WebApi action method that does this: Public Function GetSomething(Id As Integer, Optional SomeValue As Integer = 0) As HttpResponseMessage I have the standard route in place: ...
0
votes
1answer
34 views

mvc api config not working

I have issue for api config & Api controller. I implemented many ways but it's not work.issue is: My Api controller: public class HomeValuesController : ApiController { public ...
0
votes
1answer
613 views

Passing generic List<int> to WebApi method through the browser bar

Sorry if you think this is a duplicate to this one but it didn't resolve my issue. I have a WebApi method like: [AcceptVerbs("GET")] [ActionName("Search")] public EmpResults ...
0
votes
1answer
231 views

'Multiple actions were found' error

I have the following default routes setup for my web api services ... config.Routes.MapHttpRoute( name: "DefaultControllerWithIdAndAction", routeTemplate: "api/{controller}/{id}/{action}", ...
0
votes
1answer
280 views

MVC4 Web API - is it possible to add routes from within the individual controller for non-standard & custom actions?

I have an MVC web api that for the most part uses the standard route of: config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: ...
0
votes
1answer
217 views

Posting object in ASP.NET MVC API

I have an MVC application, that contains a web application in a simple mvc 4 project. Moreover I have a Windows application, that is a windows execution of the web application in an other windows ...
0
votes
1answer
337 views

Adding Routes for WebAPI in MVC 4

I've got a WebApi Controller and want to add a route. Here is my Controller ... public class ExtraInformationController : ApiController { private readonly ...
0
votes
1answer
1k views

how to handle query string parameter in asp.net web api

here is how I have routing setup. routes.MapHttpRoute( name: "Authors", routeTemplate: "api/authors", defaults: new { ...
0
votes
1answer
172 views

route request to controller based on route parameter

I want to route request to specific version controller based on version number in URI. for example, routes.MapHttpRoute( name: "APIV2", routeTemplate: ...
1
vote
0answers
58 views

Rebuilding routes table causes Web API to blow up entire site

We regularly rebuild our route table while our web application is running to add new custom urls. We've recently added some functionality using the WebAPI. After doing a: Routes.Clear(); If I try ...
1
vote
0answers
311 views

Links from OWIN hosted WebApi to MVC and vice versa

I want to generate url from mvc view to WebApi controller and from WebApi to MVC action. Normally these methods work perfectly: // mvc to webapi @Url.HttpRouteUrl("DefaultApi", new { controller = ...
1
vote
0answers
174 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 ...
0
votes
0answers
15 views

How do I bypass physical file location when defining Web API route?

I'm trying to set up a Web API route with the following path: /animal/zoo The issue here is the folder path in my project has the exact same structure /Animal/Zoo/ZooController.cs Web API will try ...
0
votes
0answers
131 views

How to configure WebApiConfig to respond xml by condition and json by default

I configure the webapi to response json by default public static void Register(HttpConfiguration config) { // Web API routes config.MapHttpAttributeRoutes(); ...
0
votes
0answers
1k views

Web Api multiple Post and Get methods in a Api Controller

The web api Get methods are giving me 404 error . Here is what i am doing Web Api routing config.Routes.MapHttpRoute( name: "DefaultApi2", routeTemplate: ...
0
votes
0answers
27 views

asp.net webapi routing - repeatable routes

I have this repeating configurations config.Routes.MapHttpRoute( name: "DefaultApi1", routeTemplate: "workspace/app1/api/{controller}/{id}", defaults: new ...
0
votes
0answers
172 views

System.Web.Http.HttpRouteCollection: What is the equivalent of RouteCollection.IgnoreRoute?

I'm trying to change a webapi project to use OWIN, based in part on this article: http://www.asp.net/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api However this appears to ...
0
votes
0answers
102 views

How do I build a web api url like /owners/xxxx/dogs?

I'm looking to build a prototype using ASP.NET Web API 4.0. How do I build the route like the following URI? /People/PersonId/Dogs /People/PersonId/Dogs/DogId Where People is the controller, ...
0
votes
0answers
270 views

asp.net web api routing is not working

I have ASP.NET Web API project which I have configured as a web application under 4.0 website in IIS. Basically I wanted to make subdomain work under website by using HTTP Module rewritting. For ...