Return-Path: X-Original-To: apmail-cxf-users-archive@www.apache.org Delivered-To: apmail-cxf-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BDC63D5CB for ; Wed, 11 Jul 2012 10:42:59 +0000 (UTC) Received: (qmail 43312 invoked by uid 500); 11 Jul 2012 10:42:58 -0000 Delivered-To: apmail-cxf-users-archive@cxf.apache.org Received: (qmail 43262 invoked by uid 500); 11 Jul 2012 10:42:58 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 43236 invoked by uid 99); 11 Jul 2012 10:42:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jul 2012 10:42:57 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sberyozkin@gmail.com designates 209.85.214.41 as permitted sender) Received: from [209.85.214.41] (HELO mail-bk0-f41.google.com) (209.85.214.41) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jul 2012 10:42:50 +0000 Received: by bkcjc3 with SMTP id jc3so824757bkc.0 for ; Wed, 11 Jul 2012 03:42:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=eOJRXj6yVUPtaLWGgMubOOLyxENn/7UbYgUwXtmdaDI=; b=je843jRSgwW7nuiLUqF5/Jpzbwwt5kpZAVtehxflHKbEwYhCS/qf7VzpPsdT97ImqE QT3dc8a8/TEFjrGNO/x0cPjPyav/nSSuylIGU9IHEqzzid/6EAdvJg3ema35OkSd+pv/ rMyzGUdRrHSU9JwSYbHQUmMAzfHZopkmOM3k+zGvY6YNe6P8KRKUvNjfX+XuhF3EbuR/ RiPEq+29tEMWZmOvFXyZ4HNycxE3VoRTLniJ6hXJP4xr58eYShSOrjxFwWOzlGWZdH6/ 29qUdLkeOpZHpE/Jtrk3Gx+iL0EHUsULw4E3X95PEyBBj15irN12e9mzopuOJZSjGAMu n/2A== Received: by 10.204.0.77 with SMTP id 13mr6872691bka.128.1342003349681; Wed, 11 Jul 2012 03:42:29 -0700 (PDT) Received: from [10.36.224.153] ([217.173.99.61]) by mx.google.com with ESMTPS id o4sm811015bkv.15.2012.07.11.03.42.28 (version=SSLv3 cipher=OTHER); Wed, 11 Jul 2012 03:42:29 -0700 (PDT) Message-ID: <4FFD5894.7010206@gmail.com> Date: Wed, 11 Jul 2012 11:42:28 +0100 From: Sergey Beryozkin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: users@cxf.apache.org CC: ramesh Subject: Re: JAX-RS CORS unable to accept POST as application/json References: <4FFD1629.5090407@gmail.com> <4FFD1681.3090304@gmail.com> <4FFD47C6.1080304@gmail.com> In-Reply-To: <4FFD47C6.1080304@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit By the way, in this case it is probably simpler to use LoggingFeature or LoggingInInterceptor as opposed to a tcp trace utility Cheers, Sergey On 11/07/12 10:30, Sergey Beryozkin wrote: > Hi > On 11/07/12 07:00, ramesh wrote: >> >> These are the annotations I use in my interface >> >> @Path("/for") >> @Produces("application/json") >> @Consumes("application/json") >> public interface CustomerService { >> >> >> @POST >> @Produces("application/json") >> @Consumes("application/json") >> @CrossOriginResourceSharing( >> allowAllOrigins = true, >> allowHeaders = { >> "content-type:application/json" >> }, >> exposeHeaders = { >> "content-type:application/json" >> } >> ) >> >> Response addMember(Customer customer); >> >> My POST request from Javascript client is getting preflighted and >> Http-Method turns to OPTIONS and Content-Type to blank. >> What are the right configurations to avoid preflight and make a >> successful POST with content-type: application/json >> > > How you capture the request from the browser ? I'd like to see what it > actually POSTs > > thanks, Sergey > >> Appreciate any help >> >> regards >> Ramesh >> >> >> >> > > -- Sergey Beryozkin Talend Community Coders http://coders.talend.com/ Blog: http://sberyozkin.blogspot.com