且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用.NET HttpWebRequest的API来读取响应HTTP头?

更新时间:2022-06-10 05:46:20

看原始响应文本(例如,使用Fiddler)。如果标题是不存在的,没有任何的C#代码量会使其出现。 :)从你已经证明什么,似乎头是不是在回应

Look at the raw response text (e.g., with Fiddler). If the header isn't there, no amount of C# code is going to make it appear. :) From what you've shown, it seems the header isn't in the response.

更新:当我去:的 http://twitter.com/account/rate_limit_status.xml 没有 X-RateLimit限额头。但是,当我去 http://twitter.com/statuses/public_timeline.xml ,它的存​​在。因此,我认为你只需要使用不同的方法。

Update: When I go to: http://twitter.com/account/rate_limit_status.xml there is no X-RateLimit-Limit header. But when I go to http://twitter.com/statuses/public_timeline.xml, it's there. So I think you just need to use a different method.

它仍然说150,但!