Handling Compression (Accept-Encoding) Sample

Long time back there was a question on forums regarding how we could achieve compression scenario via Accept-Encoding headers in Web API. Thought of bringing that sample here so that it could be useful for anyone looking for this kind of functionality. NOTE: ASP.NET Web API doesn’t have inherent support for Accept-Encoding header. Let’s assume…


Opting in controllers to show up on Help Page

By default when you install the Help Page nuget package and launch the help view, you would see help for all the controllers and their actions that are part of your application. There might be requirements where you might not want to expose all the controllers/actions on the help page. You have couple of options…


Receiving request file or data in Streamed mode at a Web API service

By default, the mode of receiving request data at a Web API service is in Buffered mode. This is good for most scenarios, but it could be a performance problem when you expect users to upload huge files to the service. In this scenario the files would be first buffered and then you would start…


Response buffering & chunking in Web Host scenarios

NOTE: The following table represents the behaviors that are part of Release Candidate(RC) version only. It does NOT represent data for currently in development bits. What is Chunked Transfer Encoding: This represented by the header “Transfer-Encoding: chunked” indicates that a Request/Response does not know the Content Length of the body that it is going to…


ASP.NET MVC4 Web API Stack Diagram – currently in development

NOTE: The following diagram is NOT a representation of the stack of Release Candidate(RC) version. But it is something which is currently in development and most probably would be available for the final release. If you would like to look at the diagram representing the stack of RC version, you can go here. A notable…


ASP.NET MVC4 Web API Stack Diagram

“A picture is worth a thousand words.” 🙂 NOTE: This stack represents the Release Candidate(RC) version only. It does not represent the stack that is part of our ongoing development.       (click the image to get a larger image) I hope you find it useful.


In memory client, host and integration testing of your Web API service

One of the great things about ASP.NET MVC4 Web API is its testability. If you have gone through my post ASP.NET MVC4 WebAPI Stack Diagram, you will notice that there is a block (green color) which says “In memory client-host using no network (HttpMessageInvoker/HttpClient)”. This post is about that block and how you could do…


Content Negotiation in ASP.NET MVC4 Web API Beta – Part 2

This is the second post in this series related to the Default Content Negotiation that ships as part of ASP.NET MVC4 Beta. I am continuing from where we left off in Part 1. 7. Up until now, we have seen how the Accept and Request Content-Type headers play a role in Conneg algorithm’s decision making…


Content Negotiation in ASP.NET MVC4 Web API Beta – Part 1

This is my first blog post…Yay! . In this blog post, I am going to describe about the Default Content Negotiation Algorithm that gets shipped as part of ASP.NET MVC4 Beta. The Web API provides a lot of nice features with which you can build RESTful services. For more details, you can look at the…