0
我有一個MVC項目正在使用.NET。如何從HeroCard的按鈕請求DirectLine API?
在我的英雄卡中有一個按鈕,我想通過單擊該按鈕向DirectLine API發出POST
請求。
var heroCard = JsonConvert.DeserializeObject<HeroCard>(attachment.Content.ToString());
if (heroCard != null) {
objchat.ChatResponse += " " + heroCard.Title + " " + heroCard.Subtitle;
if (heroCard.Images != null) {
IList<CardImage> cardImages = heroCard.Images;
foreach(var image in cardImages) {
objchat.ChatResponse += " " + RenderImageHTML(image.Url);
}
}
if (heroCard.Buttons != null) {
IList<CardAction> cardButtons = heroCard.Buttons;
foreach(var button in cardButtons) {
objchat.ChatMessage = button.Title;
objchat.ChatResponse += " " + "<input type='button' value='" + button.Title + "' >";
}
}
}
固定碼塊和語法。 – c0deNinja