Пример #1
0
        public static void delete(string path, Action <EagleRequest, HttpListenerResponse> func)
        {
            if (server == null)
            {
                throw new ServerNotStartedException();
            }

            if (path != null && path.Length != 0)
            {
                deleteMappings[PathTree.addPath(path)] = (object)func;
            }
        }
Пример #2
0
        /// <summary>
        /// Sets the path to the function to execute.
        /// </summary>
        /// <param name="path"></param>
        /// <param name="func"></param>
        public static void put(string path, Func <HttpListenerRequest, HttpListenerResponse, string> func)
        {
            if (server == null)
            {
                throw new ServerNotStartedException();
            }

            if (path != null && path.Length != 0)
            {
                putMappings[PathTree.addPath(path)] = (object)func;
            }
        }