forked from microsoft/typed-rest-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhandlers.ts
23 lines (18 loc) · 1.03 KB
/
handlers.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import * as hm from 'typed-rest-client/Handlers'
import * as cm from './common';
import * as httpm from 'typed-rest-client/HttpClient';
export async function run() {
cm.banner('Handler Samples');
const username = "";
const password = "";
const workstation = "";
const domain = "";
const url = "";
const basicHandler: hm.BasicCredentialHandler = new hm.BasicCredentialHandler(username, password);
const patHandler: hm.PersonalAccessTokenCredentialHandler = new hm.PersonalAccessTokenCredentialHandler('scbfb44vxzku5l4xgc3qfazn3lpk4awflfryc76esaiq7aypcbhs');
const ntlmHandler: hm.NtlmCredentialHandler = new hm.NtlmCredentialHandler(username, password, workstation, domain);
// These handlers would then be passed to the constructors of the http or rest modules
// const httpClient: httpm.HttpClient = new httpm.HttpClient('vsts-node-api', [ntlmHandler]);
// const response: httpm.HttpClientResponse = await httpClient.get(url);
// console.log("response code: " + response.message.statusCode);
}