我有路径“/todo/{id}”,我想获取 Id 路径参数。
[Function("Run")]
public static HttpResponseData Run([HttpTrigger(AuthorizationLevel.Anonymous, "get",
Route = "todo/{id}")] HttpRequestData req,
FunctionContext executionContext)
{
var logger = executionContext.GetLogger("GetTodo");
logger.LogInformation("C# HTTP trigger function processed a request.");
var response = req.CreateResponse(HttpStatusCode.OK);
response.Headers.Add("Content-Type", "text/plain; charset=utf-8");
response.WriteString("Welcome to Azure Functions!");
return response;
}
如何访问 Id?
提前致谢!