net.nemerosa.ontrack.client.OTHttpClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ontrack-client Show documentation
Show all versions of ontrack-client Show documentation
Generic customisable HTTP and JSON client.
package net.nemerosa.ontrack.client;
import net.nemerosa.ontrack.common.Document;
import org.apache.http.HttpEntity;
import org.apache.http.HttpHost;
import org.apache.http.client.methods.HttpRequestBase;
import org.apache.http.client.protocol.HttpClientContext;
import org.apache.http.impl.client.CloseableHttpClient;
import java.net.URL;
public interface OTHttpClient {
URL getUrl();
/**
* Gets the URL for a relative path
*
* @param path Relative path
* @param parameters Parameter for the relative path parameters (if any)
* @return Absolute URL
*/
String getUrl(String path, Object... parameters);
T get(ResponseParser responseParser, String path, Object... parameters);
T delete(ResponseParser responseParser, String path, Object... parameters);
T post(ResponseParser responseParser, HttpEntity data, String path, Object... parameters);
T put(ResponseParser responseParser, HttpEntity data, String path, Object... parameters);
T upload(ResponseParser responseParser, String name, Document file, String fileName, String path, Object... parameters);
/**
* Downloads a document
*/
Document download(String path, Object... parameters);
T request(HttpRequestBase request, final ResponseParser responseParser);
/**
* Underlying HTTP client
*/
CloseableHttpClient getHttpClient();
/**
* HTTP host
*/
HttpHost getHttpHost();
/**
* HTTP call context
*/
HttpClientContext getHttpClientContext();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy