HttpGet设置网络代理的实例代码

60 阅读1分钟
final HttpGet get = new HttpGet(mConfigUtil.getConfig("tokenurl"));
	get.setHeader("Authorization", getBasicAuth());
	get.setHeader("x-csrf-token", "fetch");
	HttpHost proxy = new HttpHost("proxy.sha.diablo.corp", 8080, "http");

	RequestConfig config = RequestConfig.custom().setProxy(proxy).build();

	get.setConfig(config);