首页 > IT职业 > IT生活 > http设置header
HttpPost httpPost = new HttpPost(url);如:Accept text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Encoding gzip, deflateAccept-Language zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3
StringEntity stringEntity = new StringEntity(data, ToolString.encoding);如:<!DOCTYPE html><html id="spLianghui"><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
HttpResponse response = httpClient.execute(httpPost);
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4422/viewspace-2817560/ ,如需转载,请注明出处,否则将追究法律责任。