How to use the artifact-engine/Providers/typed-rest-client/HttpClient.HttpClient function in artifact-engine

To help you get started, we’ve selected a few artifact-engine examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github microsoft / azure-pipelines-tasks / Tasks / JenkinsDownloadArtifactsV1 / ArtifactDetails / JenkinsRestClient.ts View on Github external
const strictSSL: boolean = ('true' !== tl.getEndpointDataParameter(endpoint, 'acceptUntrustedCerts', true));

        let requestOptions: IHttpRequestOptions = {
            ignoreSslError: !strictSSL
        };

        let proxyUrl: string = tl.getVariable("agent.proxyurl");
        if (!!proxyUrl) {
            requestOptions.proxy = tl.getHttpProxyConfiguration();
        }

        const username = tl.getEndpointAuthorizationParameter(endpoint, 'username', false);
        const password = tl.getEndpointAuthorizationParameter(endpoint, 'password', false);
        var handler = new handlers.BasicCredentialHandler(username, password);

        return new HttpClient("JenkinsRestClient", [handler], requestOptions);
    }