Welcome to Microsoft Q&A! Thanks for posting the question.
You can modify the request body as per your requirement as mentioned in the Create Function REST API document. For your reference sharing the request body that I have tested at my end for creating the HTTP trigger function.
Request Body for C# HTTP Trigger Function:
{
"properties":{
"files":{
"run.csx":"#r \"Newtonsoft.Json\"\r\n\r\nusing System.Net;\r\nusing Microsoft.AspNetCore.Mvc;\r\nusing Microsoft.Extensions.Primitives;\r\nusing Newtonsoft.Json;\r\n\r\npublic static async Task<IActionResult> Run(HttpRequest req, ILogger log)\r\n{\r\n log.LogInformation(\"C# HTTP trigger function processed a request.\");\r\n\r\n string name = req.Query[\"name\"];\r\n\r\n string requestBody = await new StreamReader(req.Body).ReadToEndAsync();\r\n dynamic data = JsonConvert.DeserializeObject(requestBody);\r\n name = name ?? data?.name;\r\n\r\n string responseMessage = string.IsNullOrEmpty(name)\r\n ? \"This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.\"\r\n : $\"Hello, {name}. This HTTP triggered function executed successfully.\";\r\n\r\n return new OkObjectResult(responseMessage);\r\n}\r\n"
},
"config":{
"bindings":[
{
"authLevel":"function",
"name":"req",
"type":"httpTrigger",
"direction":"in",
"methods":[
"get",
"post"
]
},
{
"name":"$return",
"type":"http",
"direction":"out"
}
]
}
}
}
Request Body for Python HTTP Trigger Function:
{
"properties":{
"files":{
"__init__.py":"import logging\nimport azure.functions as func\n\n\ndef main(req: func.HttpRequest) -> func.HttpResponse:\n logging.info('Python HTTP trigger function processed a request.')\n\t\n name = req.params.get('name')\n if not name:\n try:\n req_body = req.get_json()\n except ValueError:\n pass\n else:\n name = req_body.get('name')\n\n if name:\n return func.HttpResponse(f\"Hello, {name}. This HTTP triggered function executed successfully.\")\n else:\n return func.HttpResponse(\n \"This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.\",\n status_code=200\n )\n"
},
"config":{
"bindings":[
{
"authLevel":"function",
"name":"req",
"type":"httpTrigger",
"direction":"in",
"methods":[
"get",
"post"
]
},
{
"name":"$return",
"type":"http",
"direction":"out"
}
]
}
}
}
Hope the above helps. Feel free to get back to me if you need any assistance.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.