public static RequestInfo Collect(NancyContext context, ExceptionlessClient client) {
            if (context == null)
                return null;

            var info = new RequestInfo {
                ClientIpAddress = context.Request.UserHostAddress,
                HttpMethod = context.Request.Method
            };

            if (context.Request.Headers.UserAgent != null)
                info.UserAgent = context.Request.Headers.UserAgent;

            if (context.Request.Url != null) {
                info.Host = context.Request.Url.HostName;
                info.IsSecure = context.Request.Url.IsSecure;
                info.Path = context.Request.Url.BasePath + context.Request.Url.Path;
                info.Port = context.Request.Url.Port ?? 80;
            }

            if (context.Request.Headers.Referrer != null)
                info.Referrer = context.Request.Headers.Referrer;

            info.Cookies = context.Request.Cookies.ToDictionary(client);

            if (context.Request.Url != null && !String.IsNullOrWhiteSpace(context.Request.Url.Query))
                info.QueryString = HttpUtility.ParseQueryString(context.Request.Url.Query).ToDictionary(client);

            return info;
        }
        public static RequestInfo Collect(ExceptionlessClient client, HttpContextBase context) {
            if (context == null)
                return null;

            var info = new RequestInfo {
                HttpMethod = context.Request.HttpMethod,
                UserAgent = context.Request.UserAgent,
                Path = String.IsNullOrEmpty(context.Request.Path) ? "/" : context.Request.Path
            };

            try {
                info.ClientIpAddress = context.Request.UserHostAddress;
            } catch (ArgumentException ex) {
                client.Log.Error(ex, "An error occurred while setting the Client Ip Address.");
            }

            try {
                info.IsSecure = context.Request.IsSecureConnection;
            } catch (ArgumentException ex) {
                client.Log.Error(ex, "An error occurred while setting Is Secure Connection.");
            }

            if (context.Request.Url != null)
                info.Host = context.Request.Url.Host;

            if (context.Request.UrlReferrer != null)
                info.Referrer = context.Request.UrlReferrer.ToString();

            if (context.Request.Url != null)
                info.Port = context.Request.Url.Port;

            info.Cookies = context.Request.Cookies.ToDictionary(client);

            if (context.Request.Form.Count > 0)
                info.PostData = context.Request.Form.ToDictionary(client);
            else if (context.Request.ContentLength > 0 && context.Request.ContentLength < 1024 * 4) {
                try {
                    context.Request.InputStream.Position = 0;
                    using (var inputStream = new StreamReader(context.Request.InputStream))
                        info.PostData = inputStream.ReadToEnd();
                } catch (Exception ex) {
                    info.PostData = "Error retrieving POST data: " + ex.Message;
                }
            } else if (context.Request.ContentLength > 0) {
                string value = Math.Round(context.Request.ContentLength / 1024m, 0).ToString("N0");
                info.PostData = String.Format("Data is too large ({0}) to be included.", value + "kb");
            }

            try {
                info.QueryString = context.Request.QueryString.ToDictionary(client);
            } catch (Exception ex) {
                client.Log.Error(ex, "An error occurred while getting the cookies");
            }

            return info;
        }
        public static RequestInfo Collect(HttpActionContext context, ExceptionlessClient client) {
            if (context == null)
                return null;

            var info = new RequestInfo {
                ClientIpAddress = context.Request.GetClientIpAddress(),
                HttpMethod = context.Request.Method.Method
            };

            if (context.Request.Headers.UserAgent != null)
                info.UserAgent = context.Request.Headers.UserAgent.ToString();

            if (context.Request.RequestUri != null) {
                info.Host = context.Request.RequestUri.Host;
                info.IsSecure = context.Request.RequestUri.Scheme == "https";
                info.Path = String.IsNullOrEmpty(context.Request.RequestUri.LocalPath) ? "/" : context.Request.RequestUri.LocalPath;
                info.Port = context.Request.RequestUri.Port;
            }

            if (context.Request.Headers.Referrer != null)
                info.Referrer = context.Request.Headers.Referrer.ToString();

            info.Cookies = context.Request.Headers.GetCookies().ToDictionary(client);

            //if (context.Request.Form.Count > 0) {
            //    info.PostData = context.Request.Form.AllKeys.Distinct().Where(k => !String.IsNullOrEmpty(k) && !_ignoredFormFields.Contains(k)).ToDictionary(k => k, k => {
            //        try {
            //            return context.Request.Form.Get(k);
            //        } catch (Exception ex) {
            //            return ex.Message;
            //        }
            //    });
            //} else if (context.Request.ContentLength > 0 && context.Request.ContentLength < 1024 * 4) {
            //    try {
            //        context.Request.InputStream.Position = 0;
            //        using (var inputStream = new StreamReader(context.Request.InputStream)) {
            //            info.PostData = inputStream.ReadToEnd();
            //        }
            //    } catch (Exception ex) {
            //        info.PostData = "Error retrieving POST data: " + ex.Message;
            //    }
            //} else if (context.Request.ContentLength > 0) {
            //    string value = Math.Round(context.Request.ContentLength / 1024m, 0).ToString("N0");
            //    info.PostData = String.Format("Data is too large ({0}) to be included.", value + "kb");
            //}

            info.QueryString = context.Request.RequestUri.ParseQueryString().ToDictionary(client);

            return info;
        }