src/vs/platform/request/node/requestService.ts/RequestService/_request
class RequestService:	private _request(options: NodeRequestOptions, token: CancellationToken): Promise<IRequestContext> {

		return new Promise<IRequestContext>(async (c, e) => {
			let req: http.ClientRequest;

			const endpoint = parseUrl(options.url!);
			const rawRequest = options.getRawRequest
				? options.getRawRequest(options)
				: await this.getNodeRequest(options);

			const opts: https.RequestOptions = {
				hostname: endpoint.hostname,
				port: endpoint.port ? parseInt(endpoint.port) : (endpoint.protocol === 'https:' ? 443 : 80),
				protocol: endpoint.protocol,
				path: endpoint.path,
				method: options.type || 'GET',
				headers: options.headers,
				agent: options.agent,
				rejectUnauthorized: isBoolean(options.strictSSL) ? options.strictSSL : true
			};

			if (options.user && options.password) {
				opts.auth = options.user + ':' + options.password;
			}

			req = rawRequest(opts, (res: http.IncomingMessage) => {
				const followRedirects: number = isNumber(options.followRedirects) ? options.followRedirects : 3;
				if (res.statusCode && res.statusCode >= 300 && res.statusCode < 400 && followRedirects > 0 && res.headers['location']) {
					this._request({
						...options,
						url: res.headers['location'],
						followRedirects: followRedirects - 1
					}, token).then(c, e);
				} else {
					let stream: streams.ReadableStreamEvents<Uint8Array> = res;

					if (res.headers['content-encoding'] === 'gzip') {
						stream = res.pipe(createGunzip());
					}

					c({ res, stream: streamToBufferReadableStream(stream) } as IRequestContext);
				}
			});

			req.on('error', e);

			if (options.timeout) {
				req.setTimeout(options.timeout);
			}

			if (options.data) {
				if (typeof options.data === 'string') {
					req.write(options.data);
				}
			}

			req.end();

			token.onCancellationRequested(() => {
				req.abort();
				e(canceled());
			});
		});
	}