users@jersey.java.net

[Jersey] Re: Is there a size limit on the response of a REST web service?

From: Petr Jurák <petr.jurak_at_gmail.com>
Date: Tue, 17 Jul 2012 07:36:39 +0200

Hi,

There is no size limit in http protocol. Usually server platforms set size
limits for security reasons.
But your resource is bound to post, how can it work when you use GET
instead of POST?
I would suggest you to trace http request/response. I can recommend you
Advanced rest client add-on in Chrome. And you can also enable logging in
Jersey as well (see LoggingFilter).

Br,
Petr

On 17 July 2012 05:02, Peter Joole <peter.joole_at_gmail.com> wrote:

> This is getting weirder by the day. I decided to make a simple get that
> reads the text from a txt file and just returns it (nothing special). So
> what is the result I get:
>
> When the text is <15220: It works everywhere
> When it's more >15520:
> It works when you make a GET request with: a webbrowser, curl, and
> WizTools restClient (but only when you set the encoding to ISO-8850-15
> (latin 1).
> It does not work: when I use the jersey client, URLConnection or the
> Apache httpclient. Why doesn't it work properly with more than the 15520
> characters and why not in Java? Is it because curl and a webbrowser is more
> forgiving?
>
> As from what I read jersey expects UTF-8, so I made sure the input reader
> uses UTF-8 encoding and the txt file is also saved in UTF-8 encoding.
>
> I also tried the war file on a virtual linux server (Ubuntu 12.04), but
> it's the same problem there.
>
> Does anyone has an idea what could possibly cause this?
>