users@jersey.java.net

[Jersey] Re: converting GET to POST when path params are to long

From: Jakub Podlesak <jakub.podlesak_at_oracle.com>
Date: Tue, 02 Aug 2011 11:09:43 +0200

Hi Florian,

You may have a look at the PostReplaceFilter [1], which does exactly
what you want.
You only need to insert intended HTTP method (GET in this case) into the
X-HTTP-Method-Override
request header.

~Jakub

[1]http://jersey.java.net/nonav/apidocs/latest/jersey/com/sun/jersey/api/container/filter/PostReplaceFilter.html

On 2.8.2011 10:43, Florian Hehlen wrote:
>
> Hi all,
>
> Warning: this issue breaks RESTful principles... but such is life
>
> I have a situation where some of the possible more complex GET
> requests being done on my API are to long. These are primarily bulk
> requests for data and so I can split these requests into sub requests.
> This has the nasty effect of hindering performance which is the thing
> I am trying to avoid with these bulk requests.
>
> Is there an easy way to convert a GET to a POST so as to avoid these
> kinds of problems and not have to support to completely different end
> points on the server side? I know this is not what POST is supposed to
> be used for but I really need to be able to handle these corner cases.
>
> Cheers,
>
> Florian
>
>
> ------------------------------------------------------------------------
>
> The information in this e-mail is intended only for the person or
> entity to which it is addressed.
>
> It may contain confidential and /or privileged material. If someone
> other than the intended recipient should receive this e-mail, he / she
> shall not be entitled to read, disseminate, disclose or duplicate it.
>
> If you receive this e-mail unintentionally, please inform us
> immediately by "reply" and then delete it from your system. Although
> this information has been compiled with great care, neither IMC
> Financial Markets & Asset Management nor any of its related entities
> shall accept any responsibility for any errors, omissions or other
> inaccuracies in this information or for the consequences thereof, nor
> shall it be bound in any way by the contents of this e-mail or its
> attachments. In the event of incomplete or incorrect transmission,
> please return the e-mail to the sender and permanently delete this
> message and any attachments.
>
> Messages and attachments are scanned for all known viruses. Always
> scan attachments before opening them.