You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Kannan <ra...@gmail.com> on 2010/11/25 21:09:31 UTC
how to route the request based on custom header value?
Hi
I am using Flex as front-end for my REST Service. I am facing issue with
flash player. It does not support PUT / DELETE request. I am trying to make
those request by custom header value like below mentioned code.
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete);
var request:URLRequest = new URLRequest("/url/to/rest/server");
equest.method = URLRequestMethod.POST;
request.data = "dummyData"; // Some data needed, otherwise sent as GET
request!
request.requestHeaders = [new URLRequestHeader("X-HTTP-Method-Override",
"DELETE")];
oader.load(request);
So in CXF side, i need to handle if request contains custom header value
based on that request needs to route @Delete. Is it possible?
Thanks
Kannan
Re: how to route the request based on custom header value?
Posted by Sergey Beryozkin <sb...@gmail.com>.
Yes, it should work. A custom query such as ?_method=DELETE will also do
it...
cheers, Sergey
On Thu, Nov 25, 2010 at 8:09 PM, Kannan <ra...@gmail.com> wrote:
> Hi
>
> I am using Flex as front-end for my REST Service. I am facing issue with
> flash player. It does not support PUT / DELETE request. I am trying to
> make
> those request by custom header value like below mentioned code.
>
>
> var loader:URLLoader = new URLLoader();
> loader.addEventListener(Event.COMPLETE, onComplete);
> var request:URLRequest = new URLRequest("/url/to/rest/server");
> equest.method = URLRequestMethod.POST;
> request.data = "dummyData"; // Some data needed, otherwise sent as GET
> request!
> request.requestHeaders = [new URLRequestHeader("X-HTTP-Method-Override",
> "DELETE")];
> oader.load(request);
>
> So in CXF side, i need to handle if request contains custom header value
> based on that request needs to route @Delete. Is it possible?
>
> Thanks
> Kannan
>