我有一个现有的 API,我可以使用 Postman Post 成功调用它。这是一个简单的 API,具有基本身份验证,如下所示
Uri: http://api.internal.net/ws/rest/import/
Method: POST
Auth type: Basic Auth
Username: user
Password: xxxx
Body: raw
{
"$content-type": "application/octet-stream",
"$content": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
现在我想通过添加 HTTP 操作(应用内)在 Azure 逻辑应用中设置此请求,在代码视图中如下所示(内容被截断)。但是,当此操作运行时,它会返回错误代码 500 InternalServerError。
{
"type": "Http",
"inputs": {
"uri": "http://api.internal.net/ws/rest/import/",
"method": "POST",
"body": {
"$content-type": "application/octet-stream",
"$content": "Q0xNREZSIENOICAgQ0FOUE9URVggIDI0MTAwMzIyICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg....DM0NiBIT1JORVBBWU4gT04gMTAgMDNFMjIyMyBFIEEgICAgMzEzMDIgU1lMVklURSAgIFNLIENOICAgICAgICAgICAgICAgCkVPTSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAK"
},
"authentication": {
"type": "Basic",
"username": "user",
"password": "xxxx"
},
"retryPolicy": {
"type": "none"
}
},
"runAfter": {},
"runtimeConfiguration": {
"contentTransfer": {
"transferMode": "Chunked"
}
}
}
什么会导致逻辑应用程序中出现此执行问题?是因为逻辑应用程序中的请求格式不正确吗?这是我第一次使用 Logic App,我对此很不擅长。预先感谢您。
更改逻辑应用工作流 HTTP 操作中的不同设置,但没有成功。
我确实同意@Andrew B,问题应该出在API代码上,即产生对http调用的响应的服务器或函数或代码,而不是逻辑应用程序的http连接器的问题。
确保您提供正确的方法和身份验证:
如果 api 正确提供响应,则: