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/10/30 13:00:59 UTC

[JAXRS] A request GET with a body is dispatched on a @POST annotated method

Hello Sergey,

When I perform a GET request with a body, CXF is invoking a method annotated with POST instead of throwing an exception (Method not allowed)...

Is it a known problem? A "normal" behavior ?

Thanks and regards,
Anthony

RE: [JAXRS] A request GET with a body is dispatched on a @POST annotated method

Posted by "MULLER, Anthony" <an...@sap.com>.
You're right Sergey, thanks again :)

-----Original Message-----
From: Sergey Beryozkin [mailto:sberyozkin@gmail.com] 
Sent: mercredi 30 octobre 2013 13:20
To: MULLER, Anthony
Cc: users@cxf.apache.org
Subject: Re: [JAXRS] A request GET with a body is dispatched on a @POST annotated method

May be it just defaults to POST, I guess HTTP client libs will never 
allow sending a GET with the body...

Cheers, Sergey
On 30/10/13 12:15, MULLER, Anthony wrote:
> Hmm that's strange, when I look with LoggingInterceptor, I see a POST request :
>
> Encoding: ISO-8859-1
> Http-Method: POST
> Content-Type: application/xml
>
> I use HttpUrlConnection to perform the request, maybe this class modify my original request?
>
> Anthony
>
>
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> Sent: mercredi 30 octobre 2013 13:08
> To: users@cxf.apache.org
> Cc: MULLER, Anthony
> Subject: Re: [JAXRS] A request GET with a body is dispatched on a @POST annotated method
>
> Hi Anthony
> On 30/10/13 12:00, MULLER, Anthony wrote:
>> Hello Sergey,
>>
>> When I perform a GET request with a body, CXF is invoking a method annotated with POST instead of throwing an exception (Method not allowed)...
>>
>> Is it a known problem? A "normal" behavior ?
>>
> Can you give me a favor and double check that what actually arrives to
> CXF is a GET request as opposed to a POST one.
> For example, add a cxf logging feature or LoggingInInterecptor
>
> Thanks, Sergey
>
>> Thanks and regards,
>> Anthony
>>
>


Re: [JAXRS] A request GET with a body is dispatched on a @POST annotated method

Posted by Sergey Beryozkin <sb...@gmail.com>.
May be it just defaults to POST, I guess HTTP client libs will never 
allow sending a GET with the body...

Cheers, Sergey
On 30/10/13 12:15, MULLER, Anthony wrote:
> Hmm that's strange, when I look with LoggingInterceptor, I see a POST request :
>
> Encoding: ISO-8859-1
> Http-Method: POST
> Content-Type: application/xml
>
> I use HttpUrlConnection to perform the request, maybe this class modify my original request?
>
> Anthony
>
>
> -----Original Message-----
> From: Sergey Beryozkin [mailto:sberyozkin@gmail.com]
> Sent: mercredi 30 octobre 2013 13:08
> To: users@cxf.apache.org
> Cc: MULLER, Anthony
> Subject: Re: [JAXRS] A request GET with a body is dispatched on a @POST annotated method
>
> Hi Anthony
> On 30/10/13 12:00, MULLER, Anthony wrote:
>> Hello Sergey,
>>
>> When I perform a GET request with a body, CXF is invoking a method annotated with POST instead of throwing an exception (Method not allowed)...
>>
>> Is it a known problem? A "normal" behavior ?
>>
> Can you give me a favor and double check that what actually arrives to
> CXF is a GET request as opposed to a POST one.
> For example, add a cxf logging feature or LoggingInInterecptor
>
> Thanks, Sergey
>
>> Thanks and regards,
>> Anthony
>>
>


RE: [JAXRS] A request GET with a body is dispatched on a @POST annotated method

Posted by "MULLER, Anthony" <an...@sap.com>.
Hmm that's strange, when I look with LoggingInterceptor, I see a POST request :

Encoding: ISO-8859-1
Http-Method: POST
Content-Type: application/xml

I use HttpUrlConnection to perform the request, maybe this class modify my original request?

Anthony


-----Original Message-----
From: Sergey Beryozkin [mailto:sberyozkin@gmail.com] 
Sent: mercredi 30 octobre 2013 13:08
To: users@cxf.apache.org
Cc: MULLER, Anthony
Subject: Re: [JAXRS] A request GET with a body is dispatched on a @POST annotated method

Hi Anthony
On 30/10/13 12:00, MULLER, Anthony wrote:
> Hello Sergey,
>
> When I perform a GET request with a body, CXF is invoking a method annotated with POST instead of throwing an exception (Method not allowed)...
>
> Is it a known problem? A "normal" behavior ?
>
Can you give me a favor and double check that what actually arrives to 
CXF is a GET request as opposed to a POST one.
For example, add a cxf logging feature or LoggingInInterecptor

Thanks, Sergey

> Thanks and regards,
> Anthony
>


Re: [JAXRS] A request GET with a body is dispatched on a @POST annotated method

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi Anthony
On 30/10/13 12:00, MULLER, Anthony wrote:
> Hello Sergey,
>
> When I perform a GET request with a body, CXF is invoking a method annotated with POST instead of throwing an exception (Method not allowed)...
>
> Is it a known problem? A "normal" behavior ?
>
Can you give me a favor and double check that what actually arrives to 
CXF is a GET request as opposed to a POST one.
For example, add a cxf logging feature or LoggingInInterecptor

Thanks, Sergey

> Thanks and regards,
> Anthony
>