Forum Discussion
Copy Data Activity with REST API POST - Issue with request body and escape characters
- 1 year ago
Anonymous I agree that using a Copy activity is a better choice in this case compared to a Web activity. But something just does not add up in this picture: Web activity can execute the call, but the Copy activity fails. Both activities should be using the same REST connector with the same request settings. Can you compare settings of Web and Copy activities and make sure both are configured the same way? You could also paste a schreenshot of your Web activity settings here for a second check.
It is correct that the Accept header is not usually needed when the content-type header is specified. In my previous example above I did not need the Accept header. From information you provided so far it's difficult to diagnose the precise problem. You body and header look absolutely correctly from the activity input screenshot. For your original question about the body encoding the answer is yes, the encoding of the body is correct. But you say that the API returns an error. Can you post the output from your activity run or maybe a response that you get when you test with other tools like Postman?
Hello, here is the output from postman when I use the correct body and when I use the body from the copy activity with escape characters.
- apturlov1 year agoSuper User
Hi Anonymous, thanks for your reply. I don't think the ouput from Postman is helpful with debugging issue in Fabric. I was asking about the output from your pipeline run in Fabric to see specifically what error was returned by the API.
- Anonymous1 year agoNot applicable
Hi, yes this is the error given by the copy activity in the pipeline. The same call works using a Web Activity but I still want to use copy activity because the web activity fails when the response is larger than 4MB
Failure happened on 'Source' side. ErrorCode=RestCallFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Rest call failed with client error, status code 406 NotAcceptable, please check your activity settings.
Request URL: https://*************/rest/2.0/outputModule/export/json.
Response: {"statusCode":406,"titleMessage":"Not Acceptable","userMessage":"HTTP 406 Not Acceptable"},Source=Microsoft.DataTransfer.ClientLibrary,'- apturlov1 year agoSuper User
Anonymous I agree that using a Copy activity is a better choice in this case compared to a Web activity. But something just does not add up in this picture: Web activity can execute the call, but the Copy activity fails. Both activities should be using the same REST connector with the same request settings. Can you compare settings of Web and Copy activities and make sure both are configured the same way? You could also paste a schreenshot of your Web activity settings here for a second check.