fiddler抓不到请求

使用fiddler抓vertx框架发送的请求却抓不到
但是使用new URL形式就可以。这是为什么呢

    System.setProperty("http.proxyHost", "localhost");
    System.setProperty("http.proxyPort", "9999");

    String url = "http://view.news.qq.com/original/intouchtoday/n3131.html";
    Vertx vertx = Vertx.vertx();
    HttpClient client = HttpClientUtils.getDefaultHttp(vertx);
    client.postAbs(url, resHandler -> {

      resHandler.bodyHandler(bodyHandler -> {
      System.out.printf(bodyHandler.toString() + "11111111111111111111111111");
        client.close();
        return;
      });

    }).putHeader("content-length", "" + "a".getBytes().length).write("a")
            .setTimeout(3000).exceptionHandler(ex -> {
      System.out.println("time out----------------------------------------------------------");
      client.close();
      return;
    }).end();

    client.close();
    vertx.close();

以下代码可以成功抓到

        System.setProperty("http.proxyHost", "localhost");
        System.setProperty("http.proxyPort", "9999");



        try {
            URL url = new URL("http://view.news.qq.com/original/intouchtoday/n3131.html");
            URLConnection connection = url.openConnection();
            connection.getInputStream();

        } catch (MalformedURLException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
阅读 2.7k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏