ASP.NET Web API

Announcement: This forum has been replaced by Visual Studio Developer Community to provide you one convenient and responsive system for all feedback. You can now suggest new ideas, browse and vote on existing ideas in the Visual Studio Developer Community.

We’d like your suggestions and ideas to help us continuously improve future releases of ASP.NET, so we’ve partnered with UserVoice, a third-party service, to collect your feedback. Please do not send any novel or patentable ideas, copyrighted materials, samples or demos for which you do not want to grant a license to Microsoft.

This site is for feature suggestions; if you need to file a bug, you can visit our Developer Community website to get started.

Note: your use of the portal and your submission is subject to the UserVoice Terms of Service & Privacy Policy and license terms.

We look forward to hearing from you!
- The ASP.NET Team

Feedback on ASP.NET Web API

You've used all your votes and won't be able to post a new idea, but you can still search and comment on existing ideas.

There are two ways to get more votes:

  • When an admin closes an idea you've voted on, you'll get your votes back from that idea.
  • You can remove your votes from an open idea you support.
  • To see ideas you have already voted on, select the "My feedback" filter and select "My open ideas".
(thinking…)

Enter your idea and we'll search to see if someone has already suggested it.

If a similar idea already exists, you can support and comment on it.

If it doesn't exist, you can post your idea so others can support it.

Enter your idea and we'll search to see if someone has already suggested it.

  1. Execution Order of Mvc4 WebApi Action Filters

    There is no way to forecast the execution order of WebApi Action Filters. It changes randomly each time the code is changed. It would be nice to have an integer property to control the order like in normal Mvc controllers, but also respecting the order they are put on the action method would be acceptable

    290 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    4 comments  ·  Flag idea as inappropriate…  ·  Admin →
  2. Support Nested Routes

    MVC has areas, which would work nicely for this. My thoughts behind this are that it's nice to package functionality as modules, and areas serve that purpose well in MVC apps. Of course, it would be nice to be able to host nested areas, as well.

    174 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  3. Support OutputCache on WebAPI calls

    In ASP.NET MVC it easy to cache the output of a call by applying the outputcache attribute. A similar feature for WebAPI would help for cacheable resources.

    175 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    2 comments  ·  Flag idea as inappropriate…  ·  Admin →
  4. 156 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  Flag idea as inappropriate…  ·  Admin →
  5. Please provide a 'how to write unit test for Web Api' including using Task/async ApiControllers'

    The section on learning Web API needs to have a topic around writing unit tests. Web API home pages says it's 'easy to test' but then there are no topics around it. Please add a topic on unit testing

    76 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    3 comments  ·  Flag idea as inappropriate…  ·  Admin →
  6. Add ASP.NET MVC view generation features to ASP.NET Web API

    I think maintaining and working with ASP.NET MVC and ASP.NET Web API side by side in the same project is a drain on development resources and support cost.
    I would like to use ASP.NET Web API to generate Razor views via an additional NuGet package rather then relying on ASP.NET MVC.

    59 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  ASP.NET Web API  ·  Flag idea as inappropriate…  ·  Admin →
    planned  ·  Daniel Roth responded

    We plan to do work to better align ASP.NET MVC and Web API in our next release

  7. Impovements in ApiExplorer

    Right now it's impossible to add documentation of the multipart form data parameters and exclude / rename Model Binder arguments.

    55 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    under review  ·  1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  8. 48 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  ASP.NET Web API  ·  Flag idea as inappropriate…  ·  Admin →
  9. Enhance the routing API

    While I was working on WebAPIContrib I found several issues with the Routing API. I described it in more detail here: http://pedroreys.com/2012/03/14/asp-net-web-api-routing-needs-a-hug/

    41 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    under review  ·  1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  10. Remove Ambient Namespaces From Serialized XML

    Currently the XML serialisers both output namespaces that are not required:

    xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

    I'm not sure about the Data Contract serializer, but it is not difficult to supress these...

    Just pass into the Serialize method an XmlSerializerNamespaces:

    var xmlSerializerNamespaces = new XmlSerializerNamespaces();
    xmlSerializerNamespaces.Add(String.Empty, defaultNamespace);

    var xmlSerializer = new XmlSerializer(objectType);
    xmlSerializer.Serialize(xmlWriter, toBeSerialised, xmlSerializerNamespaces);

    Where defaultNamespace could be set on the GlobalConfiguration.Configuration.Formatters.XmlFormatter or it could be read from the XmlRoot attribute (if present) on the object being serialised.

    35 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
    planned  ·  Daniel Roth responded

    We are looking at exposes settings to control this behavior on the XML formatter

  11. 35 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  Flag idea as inappropriate…  ·  Admin →
    under review  ·  Daniel Roth responded

    We are looking at improving our story around PATCH. Vote this one up if you think this is important!

  12. Add SSL to HttpMethodAttribute

    Add an optional parameter to the HttpMethodAttributes to enforce SSL on methods/actions eg.

    [HttpGet(SSL=Required)]
    public .... Get(){}

    [HttpPost(SSL=Optional)]
    ...

    [HttpPut(SSL=NotSupported)]
    ...

    31 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    under review  ·  1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  13. Add a fluent OData query configuration API

    In the current release of OData Web API, security for queries is applied via the Queryable attribute or via ODataQueryOptions. The current system lacks any built-in method for restricting which fields can be used with the $filter query option. Implementing a trivial list of fields that support $filter is difficult, given that it can apply to relations.

    Instead, consider adding a "fluent" configuration API that captures this information at the entity level and allows orderby & filter to be "entity model aware" (for lack of a better term).

    For example,
    var settingsBuilder = ODataConventionSettingsBuilder();
    settingsBuilder.Entity<Order>().OrderByProperties("Id");
    settingsBuilder.Entity<Order>()
    .OrderByProperties({ "Id", "Name" }) …

    20 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    under review  ·  0 comments  ·  ASP.NET Web API  ·  Flag idea as inappropriate…  ·  Admin →
  14. Make WebAPI support everything MVC does minus views.

    I think most people expectations would rightfully (IMHO) that WebAPI would support everything MVC does minus any view rendering or ActionResult overhead. When I search the web I see many comments relating to "I can do X in MVC but not in WebAPI". Example: Multipart/form-data or jsonp handling works in MVC out of the box.

    18 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    under review  ·  1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  15. Use Reflection to Auto Populate the Allow Header

    Based on the current Route being executed, it should be possible to detect HTTP methods the same route supports and therefore populate the Allow header in the response. e.g. whilst performing a GET on /api/values it should be possible to detect that the route supports both GET and POST (in fact the code I presume already has this list so that it knows which Action to call). The Allow header could then be populated with GET, POST.

    The icing on the cake would be that the Authorize attribute is still checked so if the caller does not have permission to…

    16 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    under review  ·  4 comments  ·  Flag idea as inappropriate…  ·  Admin →
  16. Make ApiDescription.ResponseDescription setter public

    It is impossible to provide a custom implementation of IApiExplorer because the setter for ApiDescription.ResponseDescription is internal. Please either make the setter public (or make the interface internal).

    16 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    under review  ·  1 comment  ·  ASP.NET Web API  ·  Flag idea as inappropriate…  ·  Admin →
  17. Add System.Web.Http.ModelBinding.HttpPostedFileBaseModelBinder to mirror the System.Web.Mvc.HttpPostedFileBaseModelBinder

    The System.Web.Mvc.HttpPostedFileBaseModelBinder class works well.

    Can it be mirrored for the Web API

    15 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    under review  ·  1 comment  ·  ASP.NET Web API  ·  Flag idea as inappropriate…  ·  Admin →
  18. Provide a way to easily Mock HttpRequestMessage for an ApiController

    Currently it is not easy to Mock or use a DI Container to inject HttpRequestMessage into an ApiController constructor. Therefore, if you are attempting to leverage any common functionality throughout the ApiController class (such as reading common Request Headers), you cannot accomplish this today because HttpRequestMessage is only available at the Method level and not at the time the class is constructed/instantiated. Being able to use DI and Mocking of HttpRequestMessage for an ApiController constructor would be tremendously useful and helpful.

    13 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    0 comments  ·  ASP.NET Web API  ·  Flag idea as inappropriate…  ·  Admin →
  19. Mono-For-Android-compatible version of Web Api client

    The current Web Api Client is not compatible with Mono For Android, and trying to use HttpWebRequest and OData from Android mobile app. is a pain. Not sure about the amount of effort involved, but the author of Json.Net recently provided an mfa-compatible version, packaged as a Portable Class Library.

    10 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    under review  ·  1 comment  ·  Flag idea as inappropriate…  ·  Admin →
  20. Support web.config transformations on build

    It appears that WebAPI projects do not automatically transform web.config files on build. After getting used to this for other .NET project types, it's difficult to make the exception in the case of WebAPI projects.

    7 votes
    Vote
    Sign in
    (thinking…)
    Password icon
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    1 comment  ·  ASP.NET Web API  ·  Flag idea as inappropriate…  ·  Admin →
← Previous 1

ASP.NET Web API

Feedback and Knowledge Base