Ejemplo n.º 1
0
        protected internal HttpRequest(HttpListenerRequest request)
        {
            Request  = request;
            PathInfo = RawUrl.Split(new[] { '?' }, 2)[0];
            Name     = $"{HttpMethod} {PathInfo}";
            Id       = Guid.NewGuid().Truncate();
            Advanced = new AdvancedHttpRequest(request);

            /*ContentEncoding = request.ContentEncoding;
             * if (request.ContentType == null)
             * {
             *  ContentEncoding = Encoding.UTF8;
             * }*/
            ContentEncoding = Encoding.UTF8;
            try
            {
                int index = request?.RawUrl?.IndexOf("?") ?? -1;
                if (index >= 0)
                {
                    QueryString = HttpUtility.ParseQueryString(Request.RawUrl.Substring(index + 1), ContentEncoding);
                }
            }
            catch
            {
                QueryString = request.QueryString;
            }
        }
Ejemplo n.º 2
0
 protected internal HttpRequest(HttpListenerRequest request)
 {
     Request  = request;
     PathInfo = request.Url.AbsolutePath.TrimEnd('/');
     Name     = $"{HttpMethod} {PathInfo}";
     Id       = Guid.NewGuid().Truncate();
     Advanced = new AdvancedHttpRequest(request);
 }
Ejemplo n.º 3
0
 protected internal HttpRequest(Mono.Net.HttpListenerRequest request)
 {
     Request  = request;
     PathInfo = RawUrl.Split(new[] { '?' }, 2)[0];
     Name     = $"{HttpMethod} {PathInfo}";
     Id       = Guid.NewGuid().Truncate();
     Advanced = new AdvancedHttpRequest(request);
 }
Ejemplo n.º 4
0
 protected internal HttpRequest(HttpListenerRequest request)
 {
     Request    = request;
     HttpMethod = (HttpMethod)Enum.Parse(typeof(HttpMethod), Request.HttpMethod);
     PathInfo   = RawUrl.Split(new[] { '?' }, 2)[0];
     Name       = $"{HttpMethod} {PathInfo}";
     Id         = Guid.NewGuid().Truncate();
     Advanced   = new AdvancedHttpRequest(request);
 }