private static IDictionary GetResponseHeaders()

in sdk/Common/Communication/netcore/ServiceClientNewImpl.cs [83:119]


            private static IDictionary<string, string> GetResponseHeaders(HttpResponseMessage response)
            {
                var headers = response.Headers;
                var result = new Dictionary<string, string>();

                foreach(var header in headers)
                {
                    System.Text.StringBuilder sb = new System.Text.StringBuilder();
                    string s = "";
                    foreach(var val in header.Value)
                    {
                        sb.Append(s);
                        sb.Append(val);
                        s = "\r\n";
                    }
                    
                    result.Add(header.Key, sb.ToString());
                }

                if (response.Content != null && response.Content.Headers != null)
                {
                    foreach (var header in response.Content.Headers)
                    {
                        System.Text.StringBuilder sb = new System.Text.StringBuilder();
                        string s = "";
                        foreach (var val in header.Value)
                        {
                            sb.Append(s);
                            sb.Append(val);
                            s = "\r\n";
                        }

                        result.Add(header.Key, sb.ToString());
                    }
                }
                return result;
            }