[英]HttpClient GetAsync response content is different from what Fiddler is giving me
I'm running a GET request using HttpClient.GetAsync
. 我正在使用
HttpClient.GetAsync
运行GET请求。
I am then using Fiddler to capture this request and see what it throws back: 然后,我正在使用Fiddler捕获此请求并查看其返回的内容:
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. 该请求在我的C#应用中发送,然后被提琴手捕获。
Even though it is the exact same request, the html in the response is different. 即使是完全相同的请求,响应中的html也不同。
Here is the HTML I'm getting from Fiddler 这是我从Fiddler获得的HTML
And this is the HTML that is being returned with the HttpClient 这是HttpClient返回的HTML
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. 任何帮助将不胜感激,即使Fiddler捕获程序发送的相同请求,我似乎也无法弄清楚为什么我会得到两个单独的版本。
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.
所以,实际上我需要的是它,但是当我复制粘贴时,Text Visualiser并没有给我。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.