Class LoggingHTTPClient
- All Implemented Interfaces:
HTTPClient
To get full body content set Level=FINEST
-
Field Summary
Fields inherited from class DelegateHTTPClient
delegate
-
Constructor Summary
ConstructorsConstructorDescriptionLoggingHTTPClient
(HTTPClient delegate) LoggingHTTPClient
(HTTPClient delegate, String charsetName) -
Method Summary
Modifier and TypeMethodDescriptionExecutes an HTTP GET request against the provided URL and returns the server response.Executes an HTTP GET request against the provided URL and returns the server response.post
(URL url, InputStream postContent, String postContentType) Executes an HTTP POST request against the provided URL, sending the contents ofpostContent
as the POST method body and setting the Content-Type request header topostContentType
if given, and returns the server response.Executes an HTTP POST request against the provided URL, sending the contents ofpostContent
as the POST method body and setting the Content-Type request header topostContentType
if given, and returns the server response.Methods inherited from class DelegateHTTPClient
getConnectTimeout, getExtraParams, getPassword, getReadTimeout, getUser, isTryGzip, setConnectTimeout, setExtraParams, setPassword, setReadTimeout, setTryGzip, setUser
-
Constructor Details
-
LoggingHTTPClient
-
LoggingHTTPClient
-
-
Method Details
-
post
public HTTPResponse post(URL url, InputStream postContent, String postContentType) throws IOException Description copied from interface:HTTPClient
Executes an HTTP POST request against the provided URL, sending the contents ofpostContent
as the POST method body and setting the Content-Type request header topostContentType
if given, and returns the server response.If an HTTP authentication
user
andpassword
is set, the appropriate authentication HTTP header will be sent with the request.If a
connection timeout
is set, the http connection will be set to respect that timeout.If a
read timeout
is set, the http connection will be set to respect it.- Specified by:
post
in interfaceHTTPClient
- Overrides:
post
in classDelegateHTTPClient
- Parameters:
url
- the URL against which to execute the POST requestpostContent
- an input stream with the contents of the POST bodypostContentType
- the MIME type of the contents sent as the request POST body, can benull
- Returns:
- the
HTTPResponse
encapsulating the response to the HTTP POST request - Throws:
IOException
-
post
public HTTPResponse post(URL url, InputStream postContent, String postContentType, Map<String, String> headers) throws IOExceptionDescription copied from interface:HTTPClient
Executes an HTTP POST request against the provided URL, sending the contents ofpostContent
as the POST method body and setting the Content-Type request header topostContentType
if given, and returns the server response.If an HTTP authentication
user
andpassword
is set, the appropriate authentication HTTP header will be sent with the request.If a
connection timeout
is set, the http connection will be set to respect that timeout.If a
read timeout
is set, the http connection will be set to respect it.header parameter contains additional headers to add to the request.
- Specified by:
post
in interfaceHTTPClient
- Overrides:
post
in classDelegateHTTPClient
- Parameters:
url
- the URL against which to execute the POST requestpostContent
- an input stream with the contents of the POST bodypostContentType
- the MIME type of the contents sent as the request POST body, can benull
headers
- a list of custom headers to add to the request.- Returns:
- the
HTTPResponse
encapsulating the response to the HTTP POST request - Throws:
IOException
-
get
Description copied from interface:HTTPClient
Executes an HTTP GET request against the provided URL and returns the server response.If an HTTP authentication
user
andpassword
is set, the appropriate authentication HTTP header will be sent with the request.If a
connection timeout
is set, the http connection will be set to respect that timeout.If a
read timeout
is set, the http connection will be set to respect it.- Specified by:
get
in interfaceHTTPClient
- Overrides:
get
in classDelegateHTTPClient
- Parameters:
url
- the URL to retrieve- Returns:
- an
HTTPResponse
encapsulating the response to the HTTP GET request - Throws:
IOException
-
get
Description copied from interface:HTTPClient
Executes an HTTP GET request against the provided URL and returns the server response.If an HTTP authentication
user
andpassword
is set, the appropriate authentication HTTP header will be sent with the request.If a
connection timeout
is set, the http connection will be set to respect that timeout.If a
read timeout
is set, the http connection will be set to respect it.header parameter contains additional headers to add to the request.
- Specified by:
get
in interfaceHTTPClient
- Overrides:
get
in classDelegateHTTPClient
- Parameters:
url
- the URL to retrieveheaders
- a list of custom headers to add to the request.- Returns:
- an
HTTPResponse
encapsulating the response to the HTTP GET request - Throws:
IOException
-