如何将数据发送到Azure数据工厂数据流中的REST数据集?

发布于 2025-01-09 06:44:40 字数 1581 浏览 1 评论 0原文

我尝试在数据流中使用 REST 服务作为接收器数据集,但它总是失败并出现错误请求 400 错误。 接收器概述接收器设置数据流活动设置

错误

{"StatusCode":"DFExecutorUserError","Message":"由于原因导致作业失败:DF-REST_001 - 休息 - 从服务器收到错误响应(url:https://my_url,请求正文:Some({“Name”:“GREST”}),请求方法:POST,状态码:400),响应正文:Some({“error”:{“name”) :"badRequest","message":"请求正文格式无效。"}}))","详细信息":"com.microsoft.dataflow.问题:DF-REST_001 - 休息 - 从服务器收到错误响应(url:https://my_url,请求正文:Some({“Name”:“GREST”}),请求方法:POST,状态码:400),响应正文:Some({“error”:{“name”) :"badRequest","message":"请求正文格式无效。"}}))\n\tat com.microsoft.dataflow.Utils$.failure(Utils.scala:75)\n\tat org.apache.spark.sql.execution.datasources.rest.RestClient.ensureSuccessResponse(RestClient.scala:430)\n\tat org.apache.spark.sql.execution.datasources.rest.RestClient.org$apache$spark$ sql$execution$datasources$rest$RestClient$$executeRequest(RestClient.scala:415)\n\tat org.apache.spark.sql.execution.datasources.rest.RestClient.org$apache$spark$sql$execution$datasources$rest$RestClient$$executeSingleRowRequest(RestClient.scala:153)\n\tat org.apache.spark.sql.execution.datasources.rest.RestClient$$anonfun$savePartitionSingle$1$$anonfun$apply$mcV$sp$3.apply(RestClient.scala:106)\n\tat org.apache.spark. sql.execution.datasource"}

I am trying to use a REST Service as a Sink Dataset in my Dataflow, but it always fails with a Bad Request 400 Error.
sink overview
sink settings
Dataflow activity settings

Error

{"StatusCode":"DFExecutorUserError","Message":"Job failed due to reason: DF-REST_001 - Rest - Error response received from the server (url:https://my_url,request body: Some({"Name":"GREST"}), request method: POST, status code: 400), response body: Some({"error":{"name":"badRequest","message":"Request body has invalid format."}}))","Details":"com.microsoft.dataflow.Issues: DF-REST_001 - Rest - Error response received from the server (url:https://my_url,request body: Some({"Name":"GREST"}), request method: POST, status code: 400), response body: Some({"error":{"name":"badRequest","message":"Request body has invalid format."}}))\n\tat com.microsoft.dataflow.Utils$.failure(Utils.scala:75)\n\tat org.apache.spark.sql.execution.datasources.rest.RestClient.ensureSuccessResponse(RestClient.scala:430)\n\tat org.apache.spark.sql.execution.datasources.rest.RestClient.org$apache$spark$sql$execution$datasources$rest$RestClient$$executeRequest(RestClient.scala:415)\n\tat org.apache.spark.sql.execution.datasources.rest.RestClient.org$apache$spark$sql$execution$datasources$rest$RestClient$$executeSingleRowRequest(RestClient.scala:153)\n\tat org.apache.spark.sql.execution.datasources.rest.RestClient$$anonfun$savePartitionSingle$1$$anonfun$apply$mcV$sp$3.apply(RestClient.scala:106)\n\tat org.apache.spark.sql.execution.datasource"}

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

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

发布评论

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

评论(2

东风软 2025-01-16 06:44:40

状态码400是Bad Request错误,服务器因错误而无法处理请求。

可能的原因可能是由于 URL 不正确、语法错误、请求正文可能包含无效的 JSON。请检查 URL 并验证 JSON 数据。

The status code 400 is a Bad Request error, and the server cannot process the request due to an error.

The possible reasons might be due to incorrect URL, malformed syntax, request body might have invalid JSON. Please check the URL and validate JSON data.

趁年轻赶紧闹 2025-01-16 06:44:40

当您使用复制活动且方法为 POST 时,请确保在附加标头部分 key -> 中发送它。 “内容类型”值-> “应用程序-json”
输入图片此处描述

When you use copy activity and the method is POST, make sure that you send it in Additional headers section key -> "Content-Type" value -> "application-json"
enter image description here

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