diff options
author | jonmv <venstad@gmail.com> | 2022-11-07 15:20:12 +0100 |
---|---|---|
committer | jonmv <venstad@gmail.com> | 2022-11-07 15:20:12 +0100 |
commit | 4a6f833f3265a955c1a9d793fdb2ebb9eb8e0dd0 (patch) | |
tree | 231cc7ea990f1b003ccd523ab4202917a66e4954 /http-client | |
parent | 54eb99038030a5eee2cbc16fbda76c0375bcc52c (diff) |
Revert "Merge pull request #24781 from vespa-engine/revert-24777-jonmv/reapply-app-streams"
This reverts commit adc1c1fa16945d9f29778706f5bf8161434c2361, reversing
changes made to a0e9b51aaf01a425dbd6cdd1fbc8fd5ce066a9bb.
Diffstat (limited to 'http-client')
-rw-r--r-- | http-client/src/main/java/ai/vespa/hosted/client/AbstractHttpClient.java | 2 | ||||
-rw-r--r-- | http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java | 6 |
2 files changed, 1 insertions, 7 deletions
diff --git a/http-client/src/main/java/ai/vespa/hosted/client/AbstractHttpClient.java b/http-client/src/main/java/ai/vespa/hosted/client/AbstractHttpClient.java index ed3fee101ed..48bbffc7e37 100644 --- a/http-client/src/main/java/ai/vespa/hosted/client/AbstractHttpClient.java +++ b/http-client/src/main/java/ai/vespa/hosted/client/AbstractHttpClient.java @@ -173,7 +173,7 @@ public abstract class AbstractHttpClient implements HttpClient { @Override public HttpClient.RequestBuilder body(byte[] json) { - return body(HttpEntities.create(json, ContentType.APPLICATION_JSON)); + return body(() -> HttpEntities.create(json, ContentType.APPLICATION_JSON)); } @Override diff --git a/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java b/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java index ea8328ed793..4da887f0cbb 100644 --- a/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java +++ b/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java @@ -78,12 +78,6 @@ public interface HttpClient extends Closeable { RequestBuilder body(byte[] json); /** Sets the request body. */ - default RequestBuilder body(HttpEntity entity) { - if (entity.isRepeatable()) return body(() -> entity); - throw new IllegalArgumentException("entitiy must be repeatable, or a supplier must be used"); - } - - /** Sets the request body. */ RequestBuilder body(Supplier<HttpEntity> entity); /** Sets query parameters without a value, like {@code ?debug&recursive}. */ |