@atomist/automation-client
Version:
Atomist API for software low-level client
20 lines • 762 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const _ = require("lodash");
const globals_1 = require("../globals");
const httpClient_1 = require("../spi/http/httpClient");
/**
* Return a HttpClient for given url
*
* This implementation falls back to the DefaultHttpClientFactory if no
* configuration is provided and no running client instance can be found.
*/
function httpClient(url, configuration) {
let cfg = configuration;
if (!cfg && !!globals_1.automationClientInstance()) {
cfg = globals_1.automationClientInstance().configuration;
}
return _.get(cfg, "http.client.factory", httpClient_1.DefaultHttpClientFactory).create(url);
}
exports.httpClient = httpClient;
//# sourceMappingURL=http.js.map