Questions about routing within ASP.NET Web API framework
6
votes
0answers
457 views
Generating version specific help documentation pages for ASP.NET Web API application
I am using the WebAPI Versioning package to version my API by the X-Api-Header by using the "VersionHeaderVersionedControllerSelector". I am also using the Microsoft.AspNet.WebApi.HelpPage to ...
2
votes
0answers
654 views
WebAPI route message handler from other route gets called
I'm currently using WebAPI running on OWIN/Katana. I've defined two message handlers:
CorsHandler: Allowing CORS (Cross-origin resource sharing), will be applied on all HTTP messages
...
2
votes
0answers
560 views
MVC 4 Web Api Route 404 issue
I have a plain-vanilla MVC 4 Web Api project created using VS2012.
The (/api/Values) works out-of-the-box on the localhost but NOT when deployed on IIS (packages created using the standard ...
1
vote
0answers
29 views
Route URI to Different Classes Based On Method
I would like to route the same URI to two different classes based on whether the HTTP method is GET or POST. I tried doing this with RouteAttribute, but neither route works. If I remove one, the other ...
1
vote
0answers
39 views
Can you host Web API and ServiceStack on same root route?
I have a third party Reporting tool (telerik) that uses Web API services to provide reporting services. The path to the reporting services begins with api/, I can get either ServiceStack or Telerik ...
1
vote
0answers
805 views
Web API 2 routing attributes work in one controller but not another
Using .NET 4.5.1, Web API 2, Visual Studio 2013:
I have a Web API which has the following routes...
/api/providers/specialties
/api/providers/specialties/123
/api/providers/specialties/medicine
...
1
vote
0answers
480 views
ASP NET Web API 2/MVC 5 Attribute routing and constraints with forward slashes
We're using RavenDB on the backend and so all the DB keys are strings that contain forward slashes e.g. users/1 in /api/users/1/foo.
This question superseeds this question for the previous version of ...
1
vote
0answers
81 views
SelectAction fails: Multiple actions were found. Why?
I've installed the Web-Api Route Debugger to try and figure out what is going on here and it reports the following exception:-
System.InvalidOperationException was unhandled by user code
...
1
vote
0answers
196 views
MVC Web API POST request not working from client application but working from chrome Postman extension
I have a web API service with the controller as follows.
RoutePrefix("api/Product")]
public class ProductController : ApiController
{
[HttpPost]
[POST("InsertProduct")]
public ...
1
vote
0answers
195 views
Web.API works in some deployments but returns 404 in others
I have an ASP.NET WebForms app that is widely distributed. My new version adds Web.API and users have been playing with a beta. In most beta installations everything works fine, but for some installs ...
1
vote
0answers
331 views
Directing most MVC actions to a Web API Controller
I have built an MVC project with a Web API Controller. Instead of using POST, GET method, I have configured the routes to use actions in my API Controller.
Here is my router config:
var ...
0
votes
0answers
39 views
WebAPI 404 not found error in hosted environment - IIS
We are facing an issue in which WebAPI is returning error 404: NOT FOUND in IIS7 (config – Windows server 2012, .net 4.0 framework, ADFS-WIF integrated authentication)
The solution is deployed at the ...
0
votes
0answers
25 views
How to configure two listening ports for an ASP.NET MVC application?
I had a website called Foo with one application (ASP.NET MVC4 application) within it. The existing MVC application is listening to port 563.
Here is the snippet of the existing website configuration
...
0
votes
0answers
16 views
Is the URL passed to a Web API app accessible from Global.asax's Application_Start()?
I asked a related question here, but I'm thinking now:
I really don't want/need different different concrete Repository classes based on the database instance/context to be used, as I would then be ...
0
votes
0answers
47 views
Why do some REST calls that are virtually identical to working ones fail?
I have several Controllers/Repositories that expose a GetByID(int someInt) method. In most cases they work, but in a couple they fail with a 404 (not found) error.
For example, here is the code from ...