Questions about routing within ASP.NET Web API framework

learn more… | top users | synonyms

2
votes
1answer
1k views

File upload form with MVC4 Web-API: Getting Error 101 (net::ERR_CONNECTION_RESET): The connection was reset. Error

I'm getting a webpage not available error when trying to access a controller action in an MVC4 Web-API app with VS2010. I am trying to upload a small sized (less than 1MB) pdf document, create a ...
1
vote
1answer
1k views

Returning JSON with web api controller MVC

I am trying to convert a regular old controller I was using to an API controller and am having a little bit of difficulty. What these series of functions do is, in the jQuery, it iterates over a file ...
1
vote
1answer
132 views

Struct in MVC4 Web API causes route to break

I have a simple controller with a parameter-less Get and a Get that takes in an id. public class BooksController : ApiController { public IEnumerable<string> Get() { return new ...
1
vote
1answer
397 views

Routing with optional parameter in web-api

Using web-api i go to /api/cat/orders/ I specified the following routes and controller methods. I expected that the "ApiRouteWithCategoryAndExtId" route and the "GetMessageByCategoryExtId" method ...
0
votes
1answer
63 views

ASP.NET WebAPI Routing Issue

Say I have the following actions; // api/products public IEnumerable<ProductDto> GetProducts() public ProductDto GetProduct(int id) // api/products/{productId}/covers public ...
0
votes
1answer
68 views

Overload WebAPI controller action doesn't work with viewmodels?

The following works: public class UsageController : ApiController { public int GetMilk(string param1, string param2) { return -1; } public string GetBilling(string ...
0
votes
1answer
29 views

Documet webAPI in webpage of API

I have a webAPI in which I have many functions. I would like to create a page that will describe the api when a user goes to the api link. Example: I have the link: ...
3
votes
0answers
52 views

.Net Web API Routing & Help Page

I am struggling to get the API help page to show all my API endpoints, and to show them in the style I want. Here are my routes: config.Routes.MapHttpRoute("Orgs", "v1/Orgs/{orgId}", new { ...
3
votes
0answers
253 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
92 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
42 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 ...
1
vote
0answers
115 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
302 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
35 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 ...
0
votes
0answers
375 views

Asp.Net WebAPI and AttributeRouting - no overloaded attribute constructor?

I have just downloaded AttributeRouting NuGet package for WebAPI and having a problem within my controller. I thought the way to use it was to have something like: public class InboxController : ...

1 2
15 30 50 per page