Hi,
I'm looking to retrieve the server time from twitter. It should be included in the response's header. Does the API support this?
In the meantime, I have made a local change to the IToken interface to include a property for the server's datetime:
I'm looking to retrieve the server time from twitter. It should be included in the response's header. Does the API support this?
In the meantime, I have made a local change to the IToken interface to include a property for the server's datetime:
public DateTime ServerTime { get; set; }
And inside private Dictionary<string, object>[] ExecuteQuery I changed this:if (_lastHeadersResult != null && _lastHeadersResult["X-RateLimit-Remaining"] != null)
{
XRateLimitRemaining = Int32.Parse(_lastHeadersResult["X-RateLimit-Remaining"]);
}
To this:if (_lastHeadersResult != null)
{
if (_lastHeadersResult["X-RateLimit-Remaining"] != null)
{
XRateLimitRemaining = Int32.Parse(_lastHeadersResult["X-RateLimit-Remaining"]);
}
if (_lastHeadersResult["Date"] != null)
{
DateTime serverTime;
if (DateTime.TryParse(_lastHeadersResult["Date"], out serverTime))
{
ServerTime = serverTime;
}
}
}
_kurt