public virtual ResponseEnvelope Get( string url, Dictionary <string, string> headers = null, string contentType = "application/json; charset=utf-8") { _logger.Debug($"HTTP GET on {url}"); var response = _executor.Do(() => _client.GetAsync(url).Result); return(response.ToEnvelope()); }
public ResponseEnvelope Get(string url, Dictionary <string, string> headers = null) { var urlDebug = $"HTTP GET on {url}"; var errorContext = BuildErrorContext(urlDebug); _logger.Debug(urlDebug); // Act var response = _executor.Do(() => _httpClient.GetAsync(url).Result, errorContext); // Process var output = response.ToEnvelope(); _logger.Trace(output.Body); ProcessStatusCodes(output, errorContext); return(output); }
public ResponseEnvelope Get( string path, Dictionary <string, string> headers = null, bool excludeVersion = false) { // Arrange var address = MakeFinalUrl(path, excludeVersion); var urlDebug = $"HTTP GET on {address} (ContextId: {this.ObjectIdentifier})"; var errorContext = BuildErrorContext(urlDebug); _logger.Debug(urlDebug); // Act var response = _executor.Do(() => _httpClient.GetAsync(address).Result, errorContext); // Response var output = response.ToEnvelope(); _logger.Trace(output.Body); // Assert return(ProcessStatusCodes(output, urlDebug)); }