コード例 #1
0
 public HttpListenerRequestWrapper(HttpListenerRequest httpListenerRequest)
 {
     _httpListenerRequest = httpListenerRequest;
     _qs = new NameValueCollection(httpListenerRequest.QueryString);
     _headers = new NameValueCollection(httpListenerRequest.Headers);
     _cookies = new CookieCollectionWrapper(_httpListenerRequest.Cookies);
 }
コード例 #2
0
 public RedHttpResponse(HttpContext httpContext, ResponseMessage responseMessage)
 {
     HttpContext     = httpContext;
     ResponseMessage = responseMessage;
     _header         = new HeaderCollectionWrapper(ResponseMessage.Headers);
     _cookies        = new CookieCollectionWrapper(ResponseMessage.Headers.Cookies);
     _features       = new FeatureReferences <FeatureInterfaces>(httpContext.Features);
 }
コード例 #3
0
        public HttpListenerRequestWrapper(HttpListenerRequest httpListenerRequest, IPrincipal user)
        {
            _httpListenerRequest = httpListenerRequest;
            QueryString = new NameValueCollection(httpListenerRequest.QueryString);
            Headers = new NameValueCollection(httpListenerRequest.Headers);
            Cookies = new CookieCollectionWrapper(_httpListenerRequest.Cookies);
            ServerVariables = new NameValueCollection();
            User = user;

            // Set the client IP
            ServerVariables["REMOTE_ADDR"] = _httpListenerRequest.RemoteEndPoint.Address.ToString();
        }