예제 #1
0
        /// <summary>
        /// Sets the GET superglobal.
        /// </summary>
        public void SetGet(Dictionary <string, StringValues> query)
        {
            Log.PrintGet(_logger, query);

            foreach (var item in query)
            {
                Get.Add(item.Key, item.Value.ToString());
            }
        }
예제 #2
0
 public void Read()
 {
     using (System.IO.StreamReader r = new System.IO.StreamReader(Path, System.Text.Encoding.GetEncoding(enc))) {
         while (!r.EndOfStream)
         {
             Get.Add(r.ReadLine());
             ++RowCount;
         }
     }
 }
예제 #3
0
        private void InitializeServer()
        {
            Get.Add(
                _builder.GetV3IndexPath(),
                request =>
            {
                return(new Action <HttpListenerResponse>(response =>
                {
                    var mockResponse = _builder.BuildV3IndexResponse(Uri);
                    response.ContentType = mockResponse.ContentType;
                    SetResponseContent(response, mockResponse.Content);
                }));
            });

            Get.Add("/", request =>
            {
                return(ServerHandlerV3(request));
            });
        }