/// <summary> /// ctor /// </summary> /// <param name="baseUri">The root url for all requests</param> /// <param name="handler">HttpMessageHandler to use for communication</param> /// <param name="disposeHandler">Flag indicating whether to take ownership of the handler instance and dispose of when this instance is disposed</param> /// <param name="defaults">Default values to add to all requests</param> /// <param name="configureRequest">A callback function that will be called just before any request is sent</param> public DynamicRestClient(Uri baseUri, HttpMessageHandler handler, bool disposeHandler = false, DynamicRestClientDefaults defaults = null, Func <HttpRequestMessage, CancellationToken, Task> configureRequest = null) : this(HttpClientFactory.CreateClient(baseUri, handler, disposeHandler, defaults), null, null, "", configureRequest, true) => _defaultParameters = defaults?.DefaultParameters;