ServiceStack.WebHost.Endpoints.AppHostHttpListenerBase.ProcessRequest C# (CSharp) Method

ProcessRequest() protected method

protected ProcessRequest ( HttpListenerContext context ) : void
context System.Net.HttpListenerContext
return void
        protected override void ProcessRequest(HttpListenerContext context)
        {
            if (string.IsNullOrEmpty(context.Request.RawUrl)) return;

            var operationName = context.Request.GetOperationName();

            var httpReq = new HttpListenerRequestWrapper(operationName, context.Request);
            var httpRes = new HttpListenerResponseWrapper(context.Response);
            var handler = ServiceStackHttpHandlerFactory.GetHandlerForPathInfo(httpReq.HttpMethod, httpReq.PathInfo);

            var serviceStackHandler = handler as IServiceStackHttpHandler;
            if (serviceStackHandler != null)
            {
                serviceStackHandler.ProcessRequest(httpReq, httpRes, operationName);
                return;
            }

            throw new NotImplementedException("Cannot execute handler: " + handler);
        }