< prev index next >
test/java/net/httpclient/SmokeTest.java
Print this page
*** 249,259 ****
builder.header("XFixed", "yes");
}
HttpRequest request = builder.build();
! HttpResponse<String> response = client.send(request, asString());
String body = response.body();
if (!body.equals("This is foo.txt\r\n")) {
throw new RuntimeException();
}
--- 249,260 ----
builder.header("XFixed", "yes");
}
HttpRequest request = builder.build();
! BodyHandler<String> bh = BodyHandler.buffering(asString(), 13);
! HttpResponse<String> response = client.send(request, bh);
String body = response.body();
if (!body.equals("This is foo.txt\r\n")) {
throw new RuntimeException();
}
< prev index next >