cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sergey Beryozkin <sberyoz...@gmail.com>
Subject Re: JAX-RS CORS unable to accept POST as application/json
Date Wed, 11 Jul 2012 10:42:28 GMT
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

Mime
View raw message