Package de.galan.commons.net.flux
Class CommonHttpClient
java.lang.Object
de.galan.commons.net.flux.CommonHttpClient
- All Implemented Interfaces:
HttpClient
Provides a simple HTTP client for most use-cases, reusable.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSome sites may have timeouts, but the connection timeout does not seem to work reliably. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected AuthenticatorcreateAuthenticator(HttpOptions options) protected voidputAuthorization(URLConnection connection, String header, String username, String password) protected Responserequest(String resource, Method method, Map<String, String> extraHeader, Map<String, List<String>> parameters, byte[] body, HttpOptions options) request(String protocol, String host, Integer port, String path, Method method, Map<String, String> extraHeader, Map<String, List<String>> parameters, byte[] body) protected voidstartTimeoutThread(HttpURLConnection connection, HttpOptions options)
-
Constructor Details
-
CommonHttpClient
public CommonHttpClient()
-
-
Method Details
-
request
- Throws:
HttpClientException
-
request
public Response request(String protocol, String host, Integer port, String path, Method method, Map<String, String> extraHeader, Map<String, throws HttpClientExceptionList<String>> parameters, byte[] body) - Throws:
HttpClientException
-
request
public Response request(String resource, Method method, Map<String, String> extraHeader, Map<String, throws HttpClientExceptionList<String>> parameters, byte[] body, HttpOptions options) - Specified by:
requestin interfaceHttpClient- Throws:
HttpClientException
-
request
protected Response request(Method method, Map<String, String> extraHeader, byte[] body, URL url, HttpOptions options) throws HttpClientException- Throws:
HttpClientException
-
createAuthenticator
-
putAuthorization
protected void putAuthorization(URLConnection connection, String header, String username, String password) -
startTimeoutThread
-