示例#1
0
        public static async Task <HttpResponseMessage> Run([HttpTrigger(AuthorizationLevel.Anonymous, "get", "post", Route = null)] HttpRequestMessage req, TraceWriter log)
        {
            var names = await ParseInputData(req, log);

            if (names.Count == 0)
            {
                return(req.CreateResponse(HttpStatusCode.BadRequest, "Please pass a name on the query string or a List<strings> in the request body"));
            }

            var    list = NameParser.RunNames(names);
            string ret  = "C# Simple list: ";

            foreach (var item in list)
            {
                ret = ret + $"{item.Name}, ";
            }
            ret = ret.Substring(0, ret.Length - 2);
            return(req.CreateResponse(HttpStatusCode.OK, ret));
        }