我想了解为什么对提要的简单调用仅在打开提琴手时才起作用。只有当提琴手正在运行时才能访问XML提要
我看了看下面的链接,但没有一个答案似乎适用:
HttpWebRequest doesn't work except when fiddler is running
HttpWebRequest only works while fiddler is running
http://blogs.telerik.com/fiddler/posts/13-02-28/help!-running-fiddler-fixes-my-app-
我的代码是非常简单的,据正如我所看到的,它应该只是用xml文件的内容填充变量:
using (var client = new WebClient())
{
text = client.DownloadString(path);
}
请注意,如果我正在运行fiddler,这会很好地工作,但如果我在fiddler未运行时运行该超时错误(?),则失败。
我可以直接从我的broswer访问xml文件的路径 - 因此权限/访问也不会出现问题。
http://www.tfl.gov.uk/tfl/syndication/feeds/cycle-hire/livecyclehireupdates.xml
从提琴手原始输出是:
HTTP/1.1 200 OK
Via: 1.1 varnish, 1.1 ZTMG01
Connection: Keep-Alive
Proxy-Connection: Keep-Alive
Transfer-Encoding: chunked
Age: 19
Date: Mon, 22 Dec 2014 15:23:47 GMT
Content-Type: text/xml
ETag: "dce1c05f259961aeac88cebcdfdbeebe"
Server: AmazonS3
x-amz-id-2: C6oNmRATZO4E7eNiyPhyCOhqT45Mb9Wp0XXaU8KsBQf84gYeNzM9OPAOa9YBNFsL4DGsPSEs5Cw=
x-amz-request-id: 0CE21B93AC8DDC15
Last-Modified: Mon, 22 Dec 2014 15:22:31 GMT
X-TTL-RULE: 8
X-Cacheable: Yes. Cacheable
X-TTL: 60.000
X-Backend: proxy
X-Varnish: 10.76.2.236
X-Backend-Url: http://s3-eu-west-1.amazonaws.com/tfl.pub/Serco/livecyclehireupdates.xml
X-Hash-Url: /tfl.pub/Serco/livecyclehireupdates.xml
Access-Control-Allow-Origin: *
X-Varnish: 181999945 181994842
X-Banning:
X-Cache: HIT
X-Cache-Hits: 4
有没有人有任何想法,这可能是为什么?
这可能是一个代理问题? WebClient可能会'意外'消耗Fiddler的代理设置,从而阻止它运行。你可以发布成功的调用Fiddler RAW输出吗? – pixelbadger
用RAW输出更新了我的问题。 – KerSplosh