I recently converted Jersey's jacksonjsonprovider sample to run on CXF,
it's available here:
https://github.com/gmazza/jersey-samples-on-cxf/tree/master/jacksonjsonprovider
The README.html for this sample shows how the client can use open-source
cURL to provide the desired content type as a header (extra parameter)
instead of within the URL; also the sample itself has root resources
providing content in various formats: XML, JSON, and JSONP.
HTH,
Glen
On 02/22/2012 03:17 PM, anand sridhar wrote:
Hi,
I am developing REST services using CXF and am exposing each service to
provide output in multiple content types viz , application./xml,
application/json, text/html etc...
To determine what content type every request should request for, I managed
to work out that I can use cxf extensions to provide the content type as
extension.
like /api/service.xml, /api/service.json and so on.
However, I would like to know if it is possible to provide the content type
through request header and how in CXF I can read and provide output in
suitable content type.
Thanks,
Anand
--
Glen Mazza
Talend Community Coders
coders.talend.com
blog: www.jroller.com/gmazza