ApiServerHttp constructor

ApiServerHttp({
  1. required String name,
  2. required String host,
  3. int? port,
  4. String scheme = "http",
  5. ApiServerHttpClientBuilder? builder,
  6. ApiServerUriBuilder? uriBuilder,
  7. ApiServerHttpRequestBuilder? requestBuilder,
  8. ApiServerHttpResponseParser? responseParser,
})

Construct ApiServer

In name, specify a logical name of the server. In host, specify the hostname of the server. In port, specify the port of the server. In scheme, specify the scheme of the uri. In builder, specify the process of building HttpClient to communicate with the server. In uriBuilder, specify the process of building uri to request to the server. In requestBuilder, specify the process of building HttpClientRequest, an HTTP request to the server. In responseParser, specify the parsing process from HttpClientResponse, an HTTP response from the server, to the output DTO.

Implementation

ApiServerHttp(
  {
    required String name,
    required String host,
    int? port,
    String scheme = "http",
    ApiServerHttpClientBuilder? builder,
    ApiServerUriBuilder? uriBuilder,
    ApiServerHttpRequestBuilder? requestBuilder,
    ApiServerHttpResponseParser? responseParser
  }
): _requestBuilder = requestBuilder,
   _responseParser = responseParser,
    super(name:name, host:host, port:port, scheme:scheme, uriBuilder:uriBuilder)
{
  if(builder != null)builder(_client);
}