示例#1
0
        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;
        }
示例#2
0
        /// <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;
            }
        }