
java如何抓包获取http中的响应信息
1个回答
展开全部
ava程序需要设置proxy才能生效:
[java] view plaincopy
String url="http://www.zuidaima.com/";
Proxy proxy = new Proxy(java.net.Proxy.Type.HTTP,new InetSocketAddress("127.0.0.1", 8888));
URL serverUrl = new URL(url);
HttpURLConnection conn = (HttpURLConnection) serverUrl.openConnection(proxy);
[java] view plaincopy
String url="http://www.zuidaima.com/";
Proxy proxy = new Proxy(java.net.Proxy.Type.HTTP,new InetSocketAddress("127.0.0.1", 8888));
URL serverUrl = new URL(url);
HttpURLConnection conn = (HttpURLConnection) serverUrl.openConnection(proxy);
追问
浏览器打开某个网页,java可以获取到浏览器接收到某个网页的信息吗
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询