public class HttpClient extends BaseObject implements IhttpClient, ISupportInitialize, ISupportLogging
Modifier and Type | Field and Description |
---|---|
private character |
clientName
Client name.
|
private character |
clientVersion
Client version.
|
protected static java.lang.String |
ICLIENTLIBRARY |
private object<? extends IHttpClientLibrary> |
library
Client library.
|
private object<? extends IlogWriter> |
logger
Logger
|
private object<? extends ClientOptions> |
options
Client options.
|
CLIENTOPTIONS, IHTTPREQUEST, IHTTPRESPONSE
Constructor and Description |
---|
HttpClient() |
Modifier and Type | Method and Description |
---|---|
void |
__net_http_HttpClient_constructor__(character _pcClientName,
character _pcClientVersion,
object<? extends IHttpClientLibrary> _poLibrary)
Constructor.
|
static void |
__net_http_HttpClient_constructor__static__() |
void |
__net_http_HttpClient_destructor__() |
void |
__net_http_HttpClient_execute__()
Execute method.
|
private void |
_addAuthentication(object<? extends IhttpRequest> _poRequest) |
private void |
_copyCookies(IhttpMessage source,
IhttpMessage target)
Helper method to copy/transfer cookies from one message to another (usually from response to request)
|
protected void |
addUserAgent(object<? extends IhttpRequest> _p1) |
void |
destroy()
Destroy.
|
object<? extends IhttpResponse> |
execute(object<? extends IhttpRequest> _poRequest)
Execute HTTP request.
|
void |
execute(object<? extends IhttpRequest> _poRequest,
object<? extends IhttpResponse> _poResponse)
Execute HTTP request.
|
character |
getClientName()
Get client name.
|
character |
getClientVersion()
Get client version.
|
object<? extends IlogWriter> |
getLogger()
Get logger.
|
object<? extends ClientOptions> |
getOptions()
Get client options.
|
void |
initialize()
Initialize
|
static object<? extends HttpClient> |
instance() |
protected logical |
processStatusAction(object<? extends IhttpRequest> poRequest,
object<? extends IhttpResponse> poResponse)
Process HttpResponse status code.
|
void |
setLogger(object<? extends IlogWriter> _logger)
Set logger.
|
__lang_BaseObject_constructor__, __lang_BaseObject_execute__, assertNotNull, assertNotNull, clone, getLegacyClass, getNextSibling, getPrevSibling, legacyEquals, toLegacyString
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
__lang_BaseObject_constructor__, clone, getLegacyClass, getNextSibling, getPrevSibling, isTracked, legacyEquals, toLegacyString
protected static final java.lang.String ICLIENTLIBRARY
private final character clientName
private final character clientVersion
private final object<? extends ClientOptions> options
private final object<? extends IHttpClientLibrary> library
private final object<? extends IlogWriter> logger
public void destroy()
destroy
in interface ISupportInitialize
public void initialize()
initialize
in interface ISupportInitialize
public void __net_http_HttpClient_constructor__(character _pcClientName, character _pcClientVersion, object<? extends IHttpClientLibrary> _poLibrary)
_pcClientName
- client name._pcClientVersion
- client version._poLibrary
- client library.public static void __net_http_HttpClient_constructor__static__()
public void __net_http_HttpClient_destructor__()
public void __net_http_HttpClient_execute__()
protected void addUserAgent(object<? extends IhttpRequest> _p1)
public object<? extends IlogWriter> getLogger()
getLogger
in interface ISupportLogging
public void setLogger(object<? extends IlogWriter> _logger)
setLogger
in interface ISupportLogging
_logger
- The logger instance to be used by the client.public object<? extends IhttpResponse> execute(object<? extends IhttpRequest> _poRequest)
execute
in interface IhttpClient
_poRequest
- HTTP request.public static object<? extends HttpClient> instance()
public void execute(object<? extends IhttpRequest> _poRequest, object<? extends IhttpResponse> _poResponse)
execute
in interface IhttpClient
_poRequest
- HTTP request._poResponse
- HTTP Response.private void _addAuthentication(object<? extends IhttpRequest> _poRequest)
protected logical processStatusAction(object<? extends IhttpRequest> poRequest, object<? extends IhttpResponse> poResponse)
poRequest
- HTTP request.poResponse
- HTTP Response.public character getClientName()
getClientName
in interface IhttpClient
public character getClientVersion()
getClientVersion
in interface IhttpClient
public object<? extends ClientOptions> getOptions()
getOptions
in interface IhttpClient
private void _copyCookies(IhttpMessage source, IhttpMessage target)
source
- the message to copy cookies fromtarget
- the message to copy cookies into