package ru.yandex.inside.goals;

import java.net.URISyntaxException;

import org.apache.cxf.jaxrs.client.WebClient;
import org.apache.http.HttpHeaders;
import org.apache.http.client.utils.URIBuilder;

public class HttpClient {
    public static HttpClient createDefault() {
        return new HttpClient();
    }

    public WebClient create(final URIBuilder uriBuilder, final String token) throws URISyntaxException {
        final WebClient webClient = WebClient.create(uriBuilder.build());
        return webClient.header(HttpHeaders.AUTHORIZATION, "Bearer " + token);
    }
}
