Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 649

jdk11 IOException: HTTP/1.1 header parser received no bytes

$
0
0
HttpClient client = HttpClient.newBuilder()                    .sslContext(getSSLContext())                    .version(HttpClient.Version.HTTP_1_1)                    .connectTimeout(Duration.ofSeconds(connectionTimeoutSeconds))                    .build();            HttpRequest.Builder builder = HttpRequest.newBuilder();            headers.forEach(builder::header);            HttpRequest httpRequest = builder                    .uri(URI.create(url))                    .timeout(Duration.ofSeconds(requestTimeoutSeconds))                    .method(method, HttpRequest.BodyPublishers.ofString(request))                    .build();            HttpResponse<String> response = client.send(httpRequest, HttpResponse.BodyHandlers.ofString());

I try to use java HttpClinet API as above in my product env, sometime I got error response: "IOException: HTTP/1.1 header parser received no bytes" when the request volume is huge

I refer to this problem (OtherDoc), but it does not solve my problem

I want to kown why and how to fix it.Anybody can help me ?


Viewing all articles
Browse latest Browse all 649

Trending Articles