The base route.
The HTTP client.
The connection timeout in milliseconds.
The connection resolver.
The performance counters.
The default headers to be added to every request.
The logger.
The configuration options.
The number of retries.
The invocation timeout in milliseconds.
The remote service uri which is calculated on open.
Adds a correlation id (correlation_id) to invocation parameter map.
invocation parameters.
(optional) a correlation id to be added.
invocation parameters with added correlation id.
Adds filter parameters (with the same name as they defined) to invocation parameter map.
invocation parameters.
(optional) filter parameters
invocation parameters with added filter parameters.
Adds paging parameters (skip, take, total) to invocation parameter map.
invocation parameters.
(optional) paging parameters
invocation parameters with added paging parameters.
Calls a remote method via HTTP/REST protocol.
HTTP method: "get", "head", "post", "put", "delete"
a command route. Base route will be added to this route
(optional) transaction id to trace execution through call chain.
(optional) query parameters.
(optional) body object.
(optional) callback function that receives result object or error.
Closes component and frees used resources.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Configures component by passing configuration parameters.
configuration parameters to be set.
Adds instrumentation to log calls and measure call time. It returns a Timing object that is used to end the time measurement.
(optional) transaction id to trace execution through call chain.
a method name.
Timing object to end the time measurement.
Checks if the component is opened.
true if the component has been opened and false otherwise.
Opens the component.
(optional) transaction id to trace execution through call chain.
callback function that receives error or null no errors occured.
Sets references to dependent components.
references to locate the component dependencies.
Generated using TypeDoc
Abstract client that calls remove endpoints using HTTP/REST protocol.
Configuration parameters
References
*:logger:*:*:1.0
(optional) ILogger components to pass log messages*:counters:*:*:1.0
(optional) ICounters components to pass collected measurements*:discovery:*:*:1.0
(optional) IDiscovery services to resolve connectionRestService
CommandableHttpService
Example
class MyRestClient extends RestClient implements IMyClient { ... public getData(correlationId: string, id: string, callback: (err: any, result: MyData) => void): void { let timing = this.instrument(correlationId, 'myclient.get_data'); this.call("get", "/get_data" correlationId, { id: id }, null, (err, result) => { timing.endTiming(); callback(err, result); }); } ... } let client = new MyRestClient(); client.configure(ConfigParams.fromTuples( "connection.protocol", "http", "connection.host", "localhost", "connection.port", 8080 )); client.getData("123", "1", (err, result) => { ... });