【问题标题】:Monitor visual studio http request with fiddler使用提琴手监控 Visual Studio http 请求
【发布时间】:2013-09-10 13:53:02
【问题描述】:

我正在尝试在提琴手上监控来自 VS2012 的以下请求,但不能:

        var client = new HttpClient();
        client.BaseAddress = new Uri("http://localhost:8081/");
        var product = new Product() { Description = "blabla", CatalogName = "myName"};
        MediaTypeFormatter jsonFormatter = new JsonMediaTypeFormatter();
        // Use the JSON formatter to create the content of the request body.
        HttpContent content = new ObjectContent<Product>(product, jsonFormatter);
        // Send the request.
        HttpResponseMessage resp = client.PostAsync(@"odata/Products/", content).Result;
        var result = resp.Content.ReadAsStringAsync().Result;

我已经阅读了大约 2000 篇手册和提要的问候,但无法弄清楚。
有什么线索吗?

【问题讨论】:

    标签: http visual-studio-2012 asp.net-web-api fiddler


    【解决方案1】:

    只需将提琴手添加到网址

    http://localhost.fiddler:8081/
    

    流量通过 fiddler 路由,因此显示在 fiddler 上。

    附: 致谢:https://stackoverflow.com/a/13358261/805138

    【讨论】:

      【解决方案2】:

      查看此链接 - http://fiddler2.com/documentation/Configure-Fiddler/Tasks/MonitorLocalTraffic。使用机器名或 IPV4/6 适配器代替 localhost。

      【讨论】:

      • 谢谢!但如前所述,我遇到了很多博客,但对这种特定方法却缺乏了解。奇怪的是,同时使用ipv4.fiddler127.0.0.1 确实会导致“localhost”,但是当添加端口号时,例如:ipv4.fiddler:8081 不会导致与localhost:8081 相同,真是令人沮丧...
      • ipv4.fiddler 被转换为127.0.0.1ipv6.fiddler 转换为 [::1]localhost.fiddler 转换为 localhost
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-06-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多