Search code examples
c#neo4jfiddlerrestsharpwindows-server-2012

Fiddler4 in windows server 2012 provokes RestSharp Requests to be null


So I'm testing Neo4J in pure REST (no Neo4JClient) and I have this code:

       var client = new RestClient("http://url");

        string requestText = "{  \"query\" : \"start x  = node(1) match path = (x--IsFriendOf) return path, IsFriendOf.name\",  \"params\" : {  }}";

        var request = new RestRequest();

        request.Method = Method.POST;
        request.RequestFormat = DataFormat.Json;
        request.Resource = "/foo/bar";
        request.AddHeader("Content-Length", requestText.Length.ToString());
        request.AddHeader("Host", "ip:port");
        request.AddHeader("Accept", "application/json");
        request.AddHeader("Content-Type", "application/json");

        request.AddHeader("Authorization", "Basic encoded64credentials");


        request.AddBody(requestText);



        IRestResponse response = client.Execute(request);

If I do the RAW request in Fiddler itself, I get the desired result,

But if I do it in a console application in .Net 4.5, I see this:

enter image description here

I created a rule in my firewall to allow incoming/outgoing requests for the console executable, and I deactivated IE protected mode, but still, no luck.

Do anyone have some idea about this issue?


Solution

  • There are a number of things wrong here.

    The first thing to understand is that you're not actually seeing the request at all-- the request you're showing in this screenshot is IE downloading Compatibility View List information, not any request you've made yourself.

    You should probably start by reading http://blogs.msdn.com/b/fiddler/archive/2011/09/14/fiddler-and-windows-8-metro-style-applications-https-and-private-network-capabilities.aspx to understand how Windows 8 / Windows Server 2012 have changed and what you need to do to capture their traffic in a local loopback proxy.