/// <summary> /// Initializes a new instance of the HttpResponseMessageAbstraction class. /// </summary> /// <param name="statusCode"> /// The HttpStatusCode. /// </param> /// <param name="headers"> /// The headers returned. /// </param> /// <param name="content"> /// The content returned. /// </param> internal HttpResponseMessageAbstraction(HttpStatusCode statusCode, IHttpResponseHeadersAbstraction headers, string content) { this.StatusCode = statusCode; if (headers.IsNotNull()) { this.Headers = headers; } else { this.Headers = new HttpResponseHeadersAbstraction(); } this.Content = content; }
private string FormatHeaders(IHttpResponseHeadersAbstraction httpResponseHeadersAbstraction) { StringBuilder sbLog = new StringBuilder(); foreach (var header in httpResponseHeadersAbstraction) { if (header.Value is IEnumerable <string> ) { sbLog.Append(header.Key + " "); sbLog.Append(string.Join(",", header.Value as IEnumerable <string>)); } else { sbLog.Append(header.Key + " " + header.Value); } sbLog.Append(Environment.NewLine); } return(sbLog.ToString()); }
private string FormatHeaders(IHttpResponseHeadersAbstraction httpResponseHeadersAbstraction) { StringBuilder sbLog = new StringBuilder(); foreach (var header in httpResponseHeadersAbstraction) { if (header.Value is IEnumerable<string>) { sbLog.Append(header.Key + " "); sbLog.Append(string.Join(",", header.Value as IEnumerable<string>)); } else { sbLog.Append(header.Key + " " + header.Value); } sbLog.Append(Environment.NewLine); } return sbLog.ToString(); }