users@jersey.java.net

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

From: Will Ferguson <willferguson00_at_gmail.com>
Date: Mon, 13 Jan 2014 09:58:21 +0000

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