charles 抓取eclipse中的请求

charles抓取eclipse中的请求

有时候,想要监测eclipse中发送get获取post请求,一样可以使用代理方式:

1、eclipse代码设置

代码中添加,可以就写在主函数中,然后再调用请求函数。

System.setProperty("http.proxySet", "true"); 
System.setProperty("http.proxyHost", "127.0.0.1"); 
System.setProperty("http.proxyPort", "8885");

 

或者eclipse 中设置

Windows > preferences > java > installed jres 

选中installed jres > edit > 设置Default VM arguments:-Dhttp.proxySet="true" -Dhttp.proxyHost="127.0.0.1" -Dhttp.proxyPort="8888"

2、charles设置

再设置charles  中的代理,端口必须保持一致,就可以抓取eclipse中运行的请求。

 

posted @ 2016-12-02 13:14  此岸花开  阅读(1409)  评论(0编辑  收藏  举报