在azure logic app中如何获取URL编码数据的关键和值 . 我没有找到有关这方面的细节 .
我找到了使用application / x-www-url-formencoded数据的方法 .
{ "$content-type": "application/x-www-form-urlencoded", "$content": "<base64EncodedContent>", "$formdata": [{ "key": "key1", "value": "value1" }
获取代码视图中的键 @triggerBody()['$formdata'][0]['key'] .
@triggerBody()['$formdata'][0]['key']
在代码视图中获取值 @triggerBody()['$formdata'][0]['value'] .
@triggerBody()['$formdata'][0]['value']
支持某些内容类型并使用逻辑应用程序,但可能需要通过解码 $content 来手动检索邮件正文 .
$content
例如,假设您触发 application/x-www-url-formencoded 请求,其中 $content 是payload encoded作为 base64 字符串以保留所有数据 .
application/x-www-url-formencoded
base64
因为请求不是纯文本或JSON,request is stored in the action如下:
"$content-type": "application/x-www-form-urlencoded", "$content": "<Base64EncodedContent>", "$formdata": [{ "key": "ToCountry", "value": "AU" }
作为Form Data Post请求,我们可以使用函数 @triggerFormDataValue() 获取每个属性,例如 @triggerFormDataValue(‘Body’) 和 @triggerFormDataValue(‘From’) .
@triggerFormDataValue()
@triggerFormDataValue(‘Body’)
@triggerFormDataValue(‘From’)
有关详细信息,请参阅此blog .
2 回答
我找到了使用application / x-www-url-formencoded数据的方法 .
获取代码视图中的键
@triggerBody()['$formdata'][0]['key']
.在代码视图中获取值
@triggerBody()['$formdata'][0]['value']
.支持某些内容类型并使用逻辑应用程序,但可能需要通过解码
$content
来手动检索邮件正文 .例如,假设您触发
application/x-www-url-formencoded
请求,其中$content
是payload encoded作为base64
字符串以保留所有数据 .因为请求不是纯文本或JSON,request is stored in the action如下:
作为Form Data Post请求,我们可以使用函数
@triggerFormDataValue()
获取每个属性,例如@triggerFormDataValue(‘Body’)
和@triggerFormDataValue(‘From’)
.有关详细信息,请参阅此blog .