/// <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;
 }
예제 #2
0
 /// <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;
 }
예제 #3
0
        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());
        }
예제 #4
0
        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();
        }