コード例 #1
0
 private static HttpResponse ConvertResponse(HttpResponse<string> stringResponse)
 {
     return new HttpStringResponse
     {
         Headers = stringResponse.Headers,
         RawBody = stringResponse.Raw,
         Body = stringResponse.Body,
         StatusCode = stringResponse.Code
     };
 }
コード例 #2
0
 private static HttpResponse ConvertResponse(HttpResponse<Stream> binaryResponse)
 {
     return new HttpResponse
     {
         Headers = binaryResponse.Headers,
         RawBody = binaryResponse.Body,
         StatusCode = binaryResponse.Code
     };
 }
コード例 #3
0
        /// <summary>
        /// Validates the response against HTTP errors defined at the API level
        /// </summary>
        /// <param name="_response">The response recieved</param>
        /// <param name="_context">Context of the request and the recieved response</param>
		internal void ValidateResponse(HttpResponse _response, HttpContext _context)
        {
            if ((_response.StatusCode < 200) || (_response.StatusCode > 206)) //[200,206] = HTTP OK
                throw new APIException(@"HTTP Response Not OK", _context);
        }