I am using Azure Functions and I have a third party API I want to call. I have the URL to it but it is a POST method so I know to use a "post" for method type and also I know about the that I can create a class and pass the values in there as a class object.
But what if the BODY sample they need is more complex. In my case something like this below.
In that case do I still create a class? How should I model it when it more complex like this?
{
"familyHierarchy": {
"familyMembers": {
"memberIds": ["string"],
"age": 0,
"marriageDate": "string"
},
"familyGroup": "string"
},
"pageSize": 0
}
Also here is what currently I have for my method signature but not sure about FromBody that I am asking about
[FunctionName("GetFamilyInfo")]
public static async Task<IActionResult> GetFamilyInfo([HttpTrigger(AuthorizationLevel.Function, "post", Route = "families/")] HttpRequest req, ILogger log)