HttpClient constructor
HttpClient(
- String baseURL, [
- HttpClientRequester? clientRequester
Implementation
HttpClient(String baseURL, [HttpClientRequester? clientRequester]) {
var baseURL2 = baseURL.trimLeft();
if (baseURL2.endsWith('/')) {
baseURL2 = baseURL2.substring(0, baseURL2.length - 1);
}
if (baseURL2.isEmpty) {
throw ArgumentError('Invalid baseURL');
}
this.baseURL = baseURL2;
_clientRequester = clientRequester ?? createHttpClientRequester();
}