private async Task <FlexResponse> ProcessRequest(FlexRequest request) { Func <FlexRequest, Task <FlexResponse> > processor = null; if (request.Method == "GET") { Get.TryGetValue(request.Url, out processor); } else if (request.Method == "POST") { Post.TryGetValue(request.Url, out processor); } else if (request.Method == "PUT") { Put.TryGetValue(request.Url, out processor); } else if (request.Method == "DELETE") { Delete.TryGetValue(request.Url, out processor); } if (processor != null) { FlexResponse response = await processor(request); return(response); } return(DefaultResponse); }