private static HttpResult ProcessResponse(HttpResponseMessage response)
 {
     response.EnsureStatusIsSuccessful();
     StreamReader reader = new StreamReader(response.Content.ReadAsStream());
     var text = reader.ReadToEnd();
     reader.Dispose();
     return new HttpResult(response.Content.ContentType, text);
 }