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
-
Support for stream binding and simplify upload case
Provide ability for binding to Stream property. It would be nice if I could create upload as easy as it is in MVC. Please provide out of the box suport for binding multipart/form-data or octet-stream to class with stream property.
It would be also nice If I could bind field with base64 string to stream property.13 votesIn ASP.NET 5, MVC and Web API are unified into MVC 6 so you can use the MVC model to bind to stream for Web API scenarios.
-
Allow customize the formatting of error messages created with Request.CreateErrorResponse()
Currently Web Api returns error messages, which look like this:
{
"message": "Your request is invalid.",
"modelState":
{
"user.UserName": ["The UserName field is required."]
}
}The parameter prefixes ("user." in this case) makes it more cumbersome to consume on the client side. Field names in the error message should match exactly field names in the original request. Also "modelState" doesn't make much sense here because there is just a list of error messages, nothing more. By default, this response should look like this instead:
{
"message": "Your request is invalid.",
"errors":
{
"userName": ["The UserName field is required."]
} …4 votesThe CreateErrorResponse extension method is just a simple convenience method that provides a default formatting for sending back error information (based on the HttpError class). You can provide whatever error format you’d like by constructing your own HttpResponseMessage or IHttpActionResult.
-
Can I just return a Content(string) from Asp.NET Web API?
Don't even need razor I'll just create the HTML via string builder.
3 votesAbsolutely! You can just return an HttpResponseMessage with a StringContent. When HTML be sure to set the right content type header for the response.
-
Allow the return type for Help samples to be specified by an Attribute
Note that this request is about the default HelpPage code that is added through Nuget, I can fix the code myself, but i'd love to see it baked into the default code (HelpPageSampleGenerator.cs):
The way the Help samples are created based off the return type of the action is cool: If i return a Person then a Person is created with some nice sample values. But most of the time, my actions return an HttpResponse, because I need to control the headers/status codes. This is obviously considered in HelpPageSampleGenerator, there is a comment:
// Do the sample generation based on…
3 votes -
Out of the box CORS support in ASP.NET Web API
Enable CORS as a feature of ASP.NET Web API. See http://enable-cors.org/ for more details on this feature.
2 votes