コード例 #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;
            }
        }
コード例 #2
0
ファイル: HttpRequest.cs プロジェクト: johaDev/Grapevine
 protected internal HttpRequest(HttpListenerRequest request)
 {
     Request  = request;
     PathInfo = request.Url.AbsolutePath.TrimEnd('/');
     Name     = $"{HttpMethod} {PathInfo}";
     Id       = Guid.NewGuid().Truncate();
     Advanced = new AdvancedHttpRequest(request);
 }
コード例 #3
0
ファイル: HttpRequest.cs プロジェクト: Exoft/Grapevine
 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);
 }
コード例 #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);
 }