aboutsummaryrefslogtreecommitdiffstats
path: root/vespa-feed-client/src/main/java/ai/vespa/feed/client/impl/HttpRequest.java
blob: 0ad7b82347e55b307dd1d16f2579199ddf2b8016 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.feed.client.impl;

import java.time.Duration;
import java.util.Map;
import java.util.function.Supplier;

class HttpRequest {

    private final String method;
    private final String path;
    private final Map<String, Supplier<String>> headers;
    private final byte[] body;
    private final Duration timeout;

    public HttpRequest(String method, String path, Map<String, Supplier<String>> headers, byte[] body, Duration timeout) {
        this.method = method;
        this.path = path;
        this.headers = headers;
        this.body = body;
        this.timeout = timeout;
    }

    public String method() {
        return method;
    }

    public String path() {
        return path;
    }

    public Map<String, Supplier<String>> headers() {
        return headers;
    }

    public byte[] body() {
        return body;
    }

    public Duration timeout() {
        return timeout;
    }

    @Override
    public String toString() {
        return method + " " + path;
    }

}