src/vs/workbench/contrib/preferences/browser/preferencesSearch.ts/RemoteSearchProvider/getSettingsFromBing
class RemoteSearchProvider:	private getSettingsFromBing(details: IBingRequestDetails): Promise<IFilterMetadata> {
		this.logService.debug(`Searching settings via ${details.url}`);
		if (details.body) {
			this.logService.debug(`Body: ${details.body}`);
		}

		const requestType = details.body ? 'post' : 'get';
		const headers: IStringDictionary<string> = {
			'User-Agent': 'request',
			'Content-Type': 'application/json; charset=utf-8',
		};

		if (this.options.endpoint.key) {
			headers['api-key'] = this.options.endpoint.key;
		}

		const start = Date.now();
		return this.requestService.request({
			type: requestType,
			url: details.url,
			data: details.body,
			headers,
			timeout: 5000
		}, CancellationToken.None).then(context => {
			if (typeof context.res.statusCode === 'number' && context.res.statusCode >= 300) {
				throw new Error(`${JSON.stringify(details)} returned status code: ${context.res.statusCode}`);
			}

			return asJson(context);
		}).then((result: any) => {
			const timestamp = Date.now();
			const duration = timestamp - start;
			const remoteSettings: IRemoteSetting[] = (result.value || [])
				.map((r: any) => {
					const key = JSON.parse(r.setting || r.Setting);
					const packageId = r['packageid'];
					const id = getSettingKey(key, packageId);

					const value = r['value'];
					const defaultValue = value ? JSON.parse(value) : value;

					const packageName = r['packagename'];
					let extensionName: string | undefined;
					let extensionPublisher: string | undefined;
					if (packageName && packageName.indexOf('##') >= 0) {
						[extensionPublisher, extensionName] = packageName.split('##');
					}

					return <IRemoteSetting>{
						key,
						id,
						defaultValue,
						score: r['@search.score'],
						description: JSON.parse(r['details']),
						packageId,
						extensionName,
						extensionPublisher
					};
				});

			const scoredResults = Object.create(null);
			remoteSettings.forEach(s => {
				scoredResults[s.id] = s;
			});

			return <IFilterMetadata>{
				requestUrl: details.url,
				requestBody: details.body,
				duration,
				timestamp,
				scoredResults,
				context: result['@odata.context']
			};
		});
	}