Search code examples
c#httpclientfiddler

HttpClient GetAsync response content is different from what Fiddler is giving me


I'm running a GET request using HttpClient.GetAsync.

I am then using Fiddler to capture this request and see what it throws back:

    var response = await http.GetAsync("http://app.creditsafeuk.com/CSUKLive/webpages/CompanySearch/SearchResults.aspx?SelectedCountry=UK");
    response.EnsureSuccessStatusCode();
    var html = await response.Content.ReadAsStringAsync();

This request is sent in my C# app and then captured with fiddler.

Even though it is the exact same request, the html in the response is different.

Here is the HTML I'm getting from Fiddler

And this is the HTML that is being returned with the HttpClient

Any help would be much appreciated, I just can't seem to figure out why I would get two separate versions even though Fiddler is capturing the same request my program is sending.


Solution

  • I found out what it was.

    Turns out, during debugging, the text visualiser actually cuts off parts of the string if it's too long. So, what I need is actually there, but the Text Visualiser wasn't giving it to me when I copied and pasted.