You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by "Muller, Anthony" <an...@sap.com> on 2013/04/09 13:29:38 UTC

How to use "_ctype" in a RESTful webservice

Hello,

I have an RESTful webservice based on CXF.

Some calls have a specific content type, like application/pdf.

To support some clients which cannot modify http header, I wish to use the "_ctype" query parameter to provide the requested content type...

But it seems to not work... (cxf 2.3.8) : "Unsupported media type."

Can you help ?

Anthony

RE: How to use "_ctype" in a RESTful webservice

Posted by "Muller, Anthony" <an...@sap.com>.
Thanks Sergey, I will try this.

Regards,
Anthony

-----Original Message-----
From: Sergey Beryozkin [mailto:sberyozkin@gmail.com] 
Sent: mardi 9 avril 2013 14:39
To: users@cxf.apache.org
Subject: Re: How to use "_ctype" in a RESTful webservice

Hi Anthony
On 09/04/13 12:29, Muller, Anthony wrote:
> Hello,
>
> I have an RESTful webservice based on CXF.
>
> Some calls have a specific content type, like application/pdf.
>
> To support some clients which cannot modify http header, I wish to use the "_ctype" query parameter to provide the requested content type...
>
> But it seems to not work... (cxf 2.3.8) : "Unsupported media type."
>
> Can you help ?
>
I believe that in CXF 2.3.8 one would need to work with a custom CXF 
interceptor, registered in front of JAXRSInInterceptor, which would 
check Message.QUERY_STRING, and if it has a _ctype query parameter in it 
then it would set its value as a Message.CONTENT_TYPE property on the 
current message - a bit more work but this should do it

HTH, Sergey
> Anthony
>

Re: How to use "_ctype" in a RESTful webservice

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Anthony
On 09/04/13 12:29, Muller, Anthony wrote:
> Hello,
>
> I have an RESTful webservice based on CXF.
>
> Some calls have a specific content type, like application/pdf.
>
> To support some clients which cannot modify http header, I wish to use the "_ctype" query parameter to provide the requested content type...
>
> But it seems to not work... (cxf 2.3.8) : "Unsupported media type."
>
> Can you help ?
>
I believe that in CXF 2.3.8 one would need to work with a custom CXF 
interceptor, registered in front of JAXRSInInterceptor, which would 
check Message.QUERY_STRING, and if it has a _ctype query parameter in it 
then it would set its value as a Message.CONTENT_TYPE property on the 
current message - a bit more work but this should do it

HTH, Sergey
> Anthony
>