
fatjar.HttpClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of FatJar Show documentation
Show all versions of FatJar Show documentation
FatJar simple API to quick prototyping and portable web services
package fatjar;
import fatjar.dto.HttpMethod;
import fatjar.implementations.jetty.JettyHttpClient;
import java.net.HttpCookie;
import java.net.URI;
import java.nio.file.Path;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
public interface HttpClient {
static HttpClient create() {
return JettyHttpClient.create();
}
HttpClient url(String url);
HttpClient method(HttpMethod method);
HttpClient send() throws HttpClient.HttpClientException;
byte[] getContent();
String getContentAsString();
HttpClient agent(String browserAgent);
HttpClient param(String key, String value);
HttpClient file(Path filePath, String mimeType) throws HttpClientException;
HttpClient timeout(int amount, TimeUnit timeUnit);
HttpClient content(byte[] bytes, String mimeType);
HttpClient content(String fileName, String mimeType) throws HttpClientException;
HttpClient addCookie(String key, String value);
HttpClient addCookie(String uri, String key, String value);
HttpClient addCookie(URI uri, HttpCookie cookie);
List getHttpCookies();
Map> getCookies();
Map getCookies(String path);
class HttpClientException extends Throwable {
public HttpClientException(Throwable cause) {
super(cause);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy