本文整理汇总了C#中Twilio.TwiML.TwilioResponse.EnqueueTask方法的典型用法代码示例。如果您正苦于以下问题:C# TwilioResponse.EnqueueTask方法的具体用法?C# TwilioResponse.EnqueueTask怎么用?C# TwilioResponse.EnqueueTask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Twilio.TwiML.TwilioResponse
的用法示例。
在下文中一共展示了TwilioResponse.EnqueueTask方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Can_Generate_Enqueue_With_Task
public void Can_Generate_Enqueue_With_Task()
{
var response = new TwilioResponse();
var task = new Task("{'task':'attributes'}", new {priority = "10", timeout = "30"});
response.EnqueueTask(new { workflowSid = "WFXXXXX" }, task);
Assert.IsTrue(IsValidTwiML(response.ToXDocument()));
}
示例2: SendResponse
public static HttpListenerResponse SendResponse(HttpListenerContext ctx)
{
HttpListenerRequest request = ctx.Request;
HttpListenerResponse response = ctx.Response;
response.StatusCode = (int)HttpStatusCode.OK;
response.ContentType = "application/xml";
var twiml = new Twilio.TwiML.TwilioResponse();
var task = new Task("{\"account_number\":\"12345abcdef\"}", new {priority = "5", timeout = "200"});
twiml.EnqueueTask (new { workflowSid = "WW0123456789abcdef0123456789abcdef" }, task);
// alternatively
twiml.Enqueue (new { workflowSid = "WW0123456789abcdef0123456789abcdef" }, "{\"account_number\":\"12345abcdef\"}", new {priority = "5", timeout = "200"});
response.StatusDescription = twiml.ToString();
return response;
}