【发布时间】:2019-12-05 00:03:32
【问题描述】:
自适应卡收到“bad request 400”错误
我正在尝试使用 urlopen 方法从运行 Python 3.7 的 AWS Lambda 发送 POST 请求
我有一个正常的卡片请求,但自适应卡片会遇到上述错误。
工作卡示例:
{'@context': 'https://schema.org/extensions', '@type': 'MessageCard', 'themeColor': 'd63333', 'title': '红色警报 - 有问题 警报名称示例', ' text': '示例警报名称已从 OK 更改为 ALARM - Threshold Crossed: 1 个数据点 (10.0) 大于或等于阈值 (1.0)。'}
自定义卡片示例(getting bad request error - 400):
{'@context': 'https://schema.org/extensions', '@type': 'AdaptiveCard', 'padding': 'none', 'body': [{'type': 'Container', 'style': 'emphasis', 'items': [{'type': 'ColumnSet', 'columns': [{'type': 'Column', 'items': [{'type': 'Image', 'horizontalAlignment': 'Right', 'url': 'https://miro.medium.com/max/1000/1*sszpZOih_xJV_lZsDbog-Q.png', 'height': '50px', 'altText': 'MC Logo'}], 'width': 'auto'}]}] }, {'type': 'Container', 'padding': {'top': 'none', 'left': 'default', 'bottom': 'default', 'right': 'default'}, ' items': [{'type': 'Container', 'items': [{'type': 'ColumnSet', 'spacing': 'Large', 'separator': 1, 'columns': [{'type' : 'Column', 'verticalContentAlignment': 'center', 'items': [{'type': 'Image', 'horizontalAlignment': 'Center', 'style': 'Person', 'url': '@987654324 @', 'width': '60px', 'altText': '警告标志'}], 'width': '60px'}, {'type': 'Column', 'items': [{'type': 'TextBlock', 'size': 'Medium', 'text': 'Example alarm name 问题描述', 'wrap': 1}, {'type': 'TextBlock', 'spacing' :'无','文本': 'MC ETL Process notifier', 'isSubtle': 1}], 'width': 'stretch'}]}, {'type': 'FactSet', 'facts': [{'title': '事件时间:', 'value': '06/07/2019 03:10:12 AM CT'}, {'title': 'Component:', 'value': 'AWS Glue - 插入资金作业'}, {'title ':'整体夜间完成:','值':'73%'}]},{'type':'TextBlock','spacing':'Small','weight':'Bolder','color': 'Accent', 'size': 'Medium', 'text': 'Click to restart'}, {'type': 'TextBlock', 'spacing': 'Small', 'weight': 'Bolder', 'color ':'口音','大小':'中等','文本':'Click to review logs'}]}]}],'版本':'1.0'}
我的 POST 请求有什么问题?
【问题讨论】:
标签: post webhooks microsoft-teams