Azure Logic Apps -Multipart/form -data失败

发布于 2025-01-20 15:56:41 字数 1704 浏览 1 评论 0原文

我正在尝试设置一个逻辑应用程序,该应用程序将将数据发布到AWS桶(链接)接受格式为multipart/form-data的内容。但是,我无法获得成功的请求,并且只能获得某种与多部分结构有关的错误形式。

错误: < error>> code> code</code>< messages>当请求主体出乎意料地终止了</code

在Beepeptor中捕获请求以比较逻辑应用程序与标准HTTP呼叫的请求时从一个休息客户端,我可以看到两个身体都是相同的,但是标头也有所不同。逻辑应用程序添加了很多跟踪信息,但似乎也发送了不同的content-Length

VS代码REST客户端请求(正确工作):

{
  "content-length": "2425",
  "user-agent": "vscode-restclient",
  "content-type": "multipart/form-data; boundary=formBoundary",
  "accept-encoding": "gzip, deflate"
}

逻辑应用程序请求:

{
  "content-length": "2384",
  "accept-language": "en-US",
  "user-agent": "azure-logic-apps/1.0 (workflow <redacted>; version <redacted>)",
  "x-ms-workflow-id": "<redacted>",
  "x-ms-workflow-version": "<redacted>",
  "x-ms-workflow-name": "<redacted>",
  "x-ms-workflow-system-id": "/scaleunits/prod-00/workflows/<redacted>",
  "x-ms-workflow-run-id": "<redacted>",
  "x-ms-workflow-run-tracking-id": "<redacted>",
  "x-ms-workflow-operation-name": "Import_File",
  "x-ms-tracking-id": "<redacted>",
  "x-ms-correlation-id": "<redacted>",
  "x-ms-client-request-id": "<redacted>",
  "x-ms-client-tracking-id": "<redacted>",
  "x-ms-action-tracking-id": "<redacted>",
  "x-ms-activity-vector": "IN.02",
  "traceparent": "<redacted>",
  "accept-encoding": "gzip, deflate",
  "content-type": "multipart/form-data; boundary=formBoundary"
}

有关如何解决此问题的任何想法?

I'm trying to set up a Logic App that will post data to an AWS Bucket (Link) accepting content formatted as multipart/form-data. However, I'm not able to get a successful request running and only get some form of error that seems to be related to the multipart structure.

Error:
<Error><Code>IncompleteBody</Code><Message>The request body terminated unexpectedly</Message

When catching the request in Beeceptor to compare the request from Logic Apps with a standard HTTP call from a REST Client I can see that both bodies are identical but the headers differ. Logic Apps adds a lot of tracking info but also seems to send a differing Content-Length.

VS Code REST Client request (working correctly):

{
  "content-length": "2425",
  "user-agent": "vscode-restclient",
  "content-type": "multipart/form-data; boundary=formBoundary",
  "accept-encoding": "gzip, deflate"
}

Logic Apps request:

{
  "content-length": "2384",
  "accept-language": "en-US",
  "user-agent": "azure-logic-apps/1.0 (workflow <redacted>; version <redacted>)",
  "x-ms-workflow-id": "<redacted>",
  "x-ms-workflow-version": "<redacted>",
  "x-ms-workflow-name": "<redacted>",
  "x-ms-workflow-system-id": "/scaleunits/prod-00/workflows/<redacted>",
  "x-ms-workflow-run-id": "<redacted>",
  "x-ms-workflow-run-tracking-id": "<redacted>",
  "x-ms-workflow-operation-name": "Import_File",
  "x-ms-tracking-id": "<redacted>",
  "x-ms-correlation-id": "<redacted>",
  "x-ms-client-request-id": "<redacted>",
  "x-ms-client-tracking-id": "<redacted>",
  "x-ms-action-tracking-id": "<redacted>",
  "x-ms-activity-vector": "IN.02",
  "traceparent": "<redacted>",
  "accept-encoding": "gzip, deflate",
  "content-type": "multipart/form-data; boundary=formBoundary"
}

Any ideas on how to fix this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

厌倦 2025-01-27 15:56:41

显然,这些问题与如何格式化多派形式数据并添加到HTTP-重复步骤有关。我从以下格式开始:

”来源:https://medium.com/@devanshijoshi/post-multipart-form-data-data-usis-usis-usion-azure-logic-apps-8902abs-8902abs-8902ab1d7c4e

工作(如 msft docs ):

”在此处输入图像描述

文档对此非常稀缺,错误代码并没有真正指导您朝任何相关方向引导您,希望这对其他人有帮助。

Apparently the issues were related to how the multipart-form data was formatted and added to the HTTP-request step. I started with the following format:

Source: https://medium.com/@devanshijoshi/post-multipart-form-data-using-azure-logic-apps-8902ab1d7c4e

When changing it to the following format it started working (as suggested in MSFT docs):

enter image description here

The documentation is quite scarce on this and the error codes do not really direct you in any relevant direction unfortunately, hopefully this helps someone else.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文