Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Monitor visual studio http request with fiddler

I am trying to monitor the following request from VS2012 on fiddler but can't:

        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;

I've read about 2000 manual and feeds regards, but couldn't figure it out.
Any clue?

like image 617
Tomer Avatar asked Sep 10 '13 13:09

Tomer


1 Answers

By simply adding fiddler to the url

http://localhost.fiddler:8081/

Traffic is routed through fiddler and therefore being displayed on fiddler.

P.S. As credit to: https://stackoverflow.com/a/13358261/805138

like image 163
Tomer Avatar answered Oct 28 '22 00:10

Tomer