If I try this code: final CloseableHttpAsyncClient client = HttpAsyncClients.custom() .setVersionPolicy(HttpVersionPolicy.FORCE_HTTP_1) .build(); client.start();
final HttpPost method = new HttpPost("http://localhost:8884"); final Future<SimpleHttpResponse> future = client.execute( new BasicRequestProducer(method,new FileEntityProducer(new File("C:\\Temp\\mytest.txt"), 2, ContentType.create("binary/octet-stream"), false)), SimpleResponseConsumer.create(), new FutureCallback<SimpleHttpResponse>() { @Override public void completed(final SimpleHttpResponse response) { System.out.println(response.getBody()); } @Override public void failed(final Exception ex) { System.out.println( ex); } @Override public void cancelled() { System.out.println("cancelled"); } }); future.get(); client.close(CloseMode.GRACEFUL); using netcat command (i use cygwin) : while true; do echo -e "HTTP/1.1 200 OK\n" | nc -l 8884; echo -e "\n\n---------------------------------------\n"; done only the first two letters from the file are received in console. Calling requestConfigBuilder.setExpectContinueEnabled(false) has no effect because that one is false by default. On Thursday, October 19, 2023 at 02:58:31 PM GMT+3, Oleg Kalnichevski <ol...@apache.org> wrote: On 19/10/2023 13:30, vostinar laurian wrote: > Hi, > I implemented a MultiPartAsyncEntityProducer, my code is: here > > | | | > servoy-extensions/com.servoy.extensions... > | > > My code is based on FileEntityProducer , just that instead of writing just a > file content, it writes more stuff. It seems to work fine, but I have a > complaint: when using a netcat command as a server( > while true; do echo -e "HTTP/1.1 200 OK\n" | nc -l 8884; echo -e > "\n\n---------------------------------------\n"; done > ) only the first producer is sent to server (basically produce method is not > called enough times). With other servers same code works fine. Seems to me > there is some protocol problem that server expects the whole request at once > and client does some more communication. Any ideas how I can fix this issue? > Thanks! > Disable `expect-continue` handshake on the client side and try again. If that makes no difference, create a project with no dependencies on your local environment that reproduces the problem, put it on GitHub and share the link. I will take a closer look. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org