Answers for "convert json in parse inputs azure function"

0

convert json in parse inputs azure function

#r "Newtonsoft.Json"

using System.Net;
using Newtonsoft.Json;

public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
    dynamic body = await req.Content.ReadAsStringAsync();
    var e = JsonConvert.DeserializeObject<EventData>(body as string);
    return req.CreateResponse(HttpStatusCode.OK, JsonConvert.SerializeObject(e));
}

public class EventData
{
    public string Category { get; set; }
    public string Action { get; set; }
    public string Label { get; set; }
}
Posted by: Guest on August-10-2020

Code answers related to "Javascript"

Browse Popular Code Answers by Language