webview请求url的时候会在header里面增加了X-Requested-With,怎么修改这个值
HashMap headers = new HashMap();
headers.put("Referer", p.url);
headers.put("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.2.6) Gecko/20100625
Firefox/3.6.6 Greatwqs");
headers.put("Accept","text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
headers.put("Accept-Language","zh-cn,zh;q=0.5");
headers.put("Host","www.yourdomain.com");
headers.put("Accept-Charset","ISO-8859-1,utf-8;q=0.7,*;q=0.7");
headers.put("Referer", "http://www.yourdomian.com/xxxAction.html");
HttpRequestBase httpget = ......
httpget.setHeaders(headers);
给你一个思路:重写 shouldOverrideUrlLoading 方法,自己可以去构造请求,当然也能自定义header,然后通过请求结果,构造给出 response。