users@jersey.java.net

[Jersey] Re: ApacheConnector & setting Content-Length header (Jeysey Client 2.4.1)

From: Will Ferguson <willferguson00_at_gmail.com>
Date: Mon, 27 Jan 2014 11:11:29 +0000

Hi All,

Am I right to assume then that setting the content-length just isn't
possible with the ApacheConnector?

If anyone has any idea about this would be great,

Thanks,

Will


On 13 January 2014 09:58, Will Ferguson <willferguson00_at_gmail.com> wrote:

> Hi,
>
> Could anyone please explain how get Jersey / ApacheConnector to set the
> correct Content-Length header on a client request?
>
> I have a REST service that requires this be set to the size of the entity
> in a PUT request, and I can't work out how to enable it.
>
> It seems calculating it in the MessageBodyWriter has been deprecated and
> it looks like the ApacheConnector is always setting it to -1.
>
> Thanks in advance,
>
> Will
>