我想要一个 Http Trigger 函数来调用另一个 Http Trigger 函数。基本上,我试图通过 URL(HTTP 请求)访问触发器 1,触发器 1 将调用触发器 2。我想的是为触发器 2 放置修复 URL,所以你只需调用触发器 1。任何想法怎么做?
using System.Net;
public static async Task<HttpResponseMessage> Run(HttpRequestMessage req, TraceWriter log)
{
log.Info("C# HTTP trigger function processed a request.");
// parse query parameter
string name = req.GetQueryNameValuePairs()
.FirstOrDefault(q => string.Compare(q.Key, "name", true) == 0)
.Value;
// Get request body
dynamic data = await req.Content.ReadAsAsync<object>();
// Set name to query string or body data
name = name ?? data?.name;
return name == null
? req.CreateResponse(HttpStatusCode.BadRequest, "Please pass a name on the query string or in the request body")
: req.CreateResponse(HttpStatusCode.OK, "Hello " + name);
}
任何帮助深表感谢。