This project is read-only.


Topics: Web Api
Nov 1, 2010 at 5:31 PM


Awesome work! In the past I've used the WCF REST starter kit to implement REST services and I've experienced its limitations.... WCF was built with SOAP and XML in mind and extending REST services based on that foundation (no pun intended) was rather painful (i.e. Working with the class Message). And now my question:

HTML 4 and XHTML 1.0 forms don't support the PUT and DELETE HTTP methods. Is there any plan to implement tunneling over POST (i.e. Rails) to get around this limitation?



Nov 1, 2010 at 11:04 PM

They are definitely considering it.  My response was they should implement it only if we can access the same extensibility mechanism :-).  It's not a straightforward as using a processor because the HTTP method is already been determined before the processor pipeline is hit.  To do it you need to hook into the the operation selection mechanism.   

Also, HTML5 Forms is no longer planning on doing PUT and DELETE.  It was removed recently.



Nov 2, 2010 at 4:12 AM

Our new Http Channels would be the place to do this.

Nov 4, 2010 at 3:42 PM

I've opened a case at Vote it up! I'm planning to work on this myself as soon as time permits.


Nov 4, 2010 at 5:31 PM


I just voted this up.  I may try to work on this as well.  I used this one in the past for the REST Starter Kits Interceptors.

    public class XHttpMethodOverrideInterceptor : RequestInterceptor
        public XHttpMethodOverrideInterceptor() : base(true) { }

        public override void ProcessRequest(ref RequestContext requestContext)
            if (requestContext == null || requestContext.RequestMessage == null)
            Message message = requestContext.RequestMessage;
            HttpRequestMessageProperty reqProp = (HttpRequestMessageProperty)message.Properties[HttpRequestMessageProperty.Name];
            string methodOverrideVal = reqProp.Headers["X-HTTP-Method-Override"];
            if (!string.IsNullOrEmpty(methodOverrideVal))
                reqProp.Method = methodOverrideVal;
Nov 4, 2010 at 8:52 PM

The best place to handle this will be through the new channel model we are introducing. At that level you can easily change the headers and such before operation selection occurs.

Apr 17, 2011 at 9:11 AM

I've implemented this with the new message channels...

Apr 17, 2011 at 10:16 AM

Nice post Javi. I left a suggestion for you on your blog.

Aug 4, 2011 at 7:34 AM


Given that use of the X-HTTP-Method-Override header is a very common scenario, especially in the enterprise (where we are often only able to use GET, POST, HEAD, OPTIONS, and TRACE verbs) I would very much like to see support for override of original HTTP verb based on this header be supported out of the box in the WCF Web API.

I defintely think you should have a quick start that specifically covers how to use the X-HTTP-Method-Override header regardless of the direction the team decides to go.

Any time frame for when we we see a new drop with the channel model? Keep up the great work, I am looking forward to RTM.

Aug 4, 2011 at 8:12 AM

Channels are there now. If you look at javic's post you can see how to do it.

Aug 4, 2011 at 4:49 PM

Blocked by my work proxy, but I will definitely check out his blog post at home. I have been impressed by how extensible you have made this framework, seems like there is always a way to accomplish our goals.