Beispiel #1
0
        public static KnownEndpointEntity FromRequest(Request endpoint)
        {
            KnownEndpointEntity model = new KnownEndpointEntity();

            model.url    = endpoint.Url.AbsoluteUri;
            model.method = endpoint.Method.ToString();

            StringBuilder sb = new StringBuilder();

            foreach (string key in endpoint.Headers.Keys)
            {
                foreach (string value in endpoint.Headers[key])
                {
                    sb.Append(key);
                    sb.Append(": ");
                    sb.Append(value);
                    sb.Append('\n');
                }
            }
            model.headers = sb.ToString();

            model.content = endpoint.Content;

            return(model);
        }