Re: putRequest outputStream

2016-02-22 Thread Oleg Kalnichevski
On Mon, 2016-02-22 at 08:23 -0700, pavel wrote:
> Hi, Oleg.
> 
> I find can upload data if return from:
> @Override
> public long getContentLength() {
> return -1;
> } 
> some data length, instead of -1. Now I find walk around, though I think will
> use HttpClient further and logging option will be useful.
> 

Most likely the server can't handle chunk coded transfer encoding.

Oleg


-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org



Re: putRequest outputStream

2016-02-22 Thread pavel
Hi, Oleg.

I find can upload data if return from:
@Override
public long getContentLength() {
return -1;
} 
some data length, instead of -1. Now I find walk around, though I think will
use HttpClient further and logging option will be useful.

Thanks.



--
View this message in context: 
http://httpcomponents.10934.n7.nabble.com/putRequest-outputStream-tp27956p27963.html
Sent from the HttpClient-User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org



Re: putRequest outputStream

2016-02-22 Thread Oleg Kalnichevski
On Sun, 2016-02-21 at 15:41 -0700, pavel wrote:
> Hello
> 
> I am new with CloseableHttpClient and HttpPut and want to use them, because
> with java core HttpUrlConnection class I have to fully populate OutputStream
> with data, before it starts transfer to server. While my data to send size
> is big, this is not fits my need, because takes too much RAM. Data
> collection speed much less than upload speed to server, where I want to PUT
> data, so I want to use HttpPut with output stream. I was able to swithch
> from Java core class and make PUT request with CloseableHttpClient and
> HttpPut but only with short String data by ByteArrayEntity. When I try to
> PUT with OutputStream, I get no errors/exceptions, but data entity not
> transferred. After run I see on target server updated file, with zero
> length. My network Interface traffic very small and looks like no entity
> data transferred. 

You can see what gets written to the underlying socket by turning on
wire logging as described here.

http://hc.apache.org/httpcomponents-client-4.5.x/logging.html

Oleg


-
To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org
For additional commands, e-mail: httpclient-users-h...@hc.apache.org