aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-feed-client-api/src/main/java/ai/vespa/feed/client/HttpResponse.java
blob: 480bd3d0b3c6a7fa9d46b8b89742cbb6ea330a60 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.feed.client;

public interface HttpResponse {

    int code();
    byte[] body();

    default String contentType() { return "application/json"; }

    static HttpResponse of(int code, byte[] body) {
        return new HttpResponse() {
            @Override public int code() { return code; }
            @Override public byte[] body() { return body; }
        };
    }

}