I'm new to OpenRasta and seem to be having issues with the
HttpMethodOverriderContributor. I've followed the instructions for
Overiding POST listed here:
http://trac.caffeine-it.com/openrasta/wiki/Doc/BuildingSites/DownLevel
I'm using Fiddler to send request and test. My Get and Post functions
are working fine. However, when I send this:
POST
http://localhost:57783/home HTTP/1.1
X-HTTP-Method-Override: PUT
Host: localhost:57783
I get the following error:
'Overriding the http method is not supported on method PUT'
'The X-HTTP-Method-Override http header can only be added to requests
that are sent as a POST.
Http methods are case-sensitive, make sure the method is in all upper-
case.'
When I put a break point in OverrideHttpVerb (from
HttpMethodOverriderContributor) I notice that it executes twice. The
first time context.Request.HttpMethod is set to "POST" and everything
executes fine. Then it overrides context.Request.HttpMethod with the X-
HTTP-Method-Override value. So the second time
context.Request.HttpMethod is now equal to "PUT" and it fails the
"POST" test and returns the error.
Is there something I'm doing wrong that is causing the Contributor to
execute twice.
I am using OpenRasta Stable 2.0. My config class is as follows:
public class Configuration : IConfigurationSource
{
public void Configure()
{
using (OpenRastaConfiguration.Manual)
{
//Override support for GET and POST only clients
ResourceSpace.Uses.PipelineContributor<HttpMethodOverriderContributor>();
//Home Resource and Handler
ResourceSpace.Has.ResourcesOfType<Home>()
.AtUri("/home")
.HandledBy<HomeHandler>()
.RenderedByAspx("~/Views/HomeView.aspx");
}
}
}