groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edinson E. PadrĂ³n Urdaneta <>
Subject Re: 512k limit ?
Date Wed, 27 Apr 2016 12:03:08 GMT
Hi there,

It should be notice that `HttpURLConnection` comes from Java and not from

After a quick Google search I got:

"HttpURLConnection does support the POST method, try
setRequestMethod("POST"). Also persistent connections are supported. Note
that the connection is only re-used after you have read the response body.
In the code example you posted it doesn't look like you are reading the
response. Since jdk6 the HTTP protocol handler will attempt to read-ahead
to make the connection available for re-use. It reads to up ~512k so if the
HTTP server returns megabytes of data and you aren't reading it then the
connection will be closed and not re-used." [1]

*will* reuse connections if it can

For this to work, several preconditions need to be fulfilled, mostly on the
server side. Those preconditions are described in the article linked to
above." [2]

Hope it helps. And remember, Google is your friend.

On Wed, Apr 27, 2016 at 6:46 AM, Philippe Chantry <> wrote:

> Hi all,
> I'm trying to upload files to an ECM with a multipart POST HTTP request
> using HttpURLConnection.
> It works fine if the file size is less than or equal to 524288 bytes (=
> 512k), and fails if the file is larger.
> Is 512k an inner limitation of groovy for a POST parameter size ? Is there
> some workarounds ?
> (The same program written in pure java has not this limitation problem.)
> Thank you,
> Philippe

View raw message