internal HttpResponse(HttpResponseMessage resp, byte[] body) { StatusCode = resp.StatusCode; ReasonPhrase = resp.ReasonPhrase; Headers = resp.Headers; RequestMessage = resp.RequestMessage; IsSuccessStatusCode = resp.IsSuccessStatusCode; RateLimit = RateLimitInfo.FromHttp(resp); _body = body; }
/// <summary> /// </summary> /// <param name="resp"></param> public RateLimitExceededException(HttpResponseMessage resp) { RateLimitInfo?info = RateLimitInfo.FromHttp(resp); if (info == null) { throw new Exception("Could not parse rate limit info"); } else { RateLimit = (RateLimitInfo)info; } }