0

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"}

2 Answers 2

0

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.

Sign up to request clarification or add additional context in comments.

Comments

0

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.