Rest call failed with client error, status 406 NotAccepteble

Tony Johansson 40 Reputation points
2023-02-09T12:41:50.8066667+00:00

When I test with Advanced Rest Client(Arc) all nine API calls to REST API works fine. I use method Get with two headers the first is Authorization Bearer the second one is Content-type application/json. It works even if I remove header Content-type application/json Here is a screenshot of the response from Arc. This same REST API call give error from Azure Data Factory(ADF). Sceenshot from Arc I call nine REST API from Azure Data Factory(ADF) with the same base url but different Relative URL. Out of these nine 6 works perfect. When I use Azure Data Factory(ADF) I use additional header Authorization Bearer @{activity('GetToken').output.access} What is strange is that the exact same call from Arc works fine but I get error when I call from ADF. Note also that I get the exact same error if I remove the additional header Authorization Bearer @{activity('GetToken').output.access} I mean that the code in REST API doesn't know if the call is comming from Arc or ADF.

Note also the the error is from the source side so my call to REST API with method GET can't be handled by the REST API code for some reason. According to the documentation for the REST API it says that Headers Content-type application/json and Authorization Bearer I tried to add a second additional header in ADF Headers Content-type application/json but I get REST connector ignores any "Content-Type" header specified in additional headers when request body is empty. I have tried to find any sensible information about my error but there no one that have had any similar. What I find very strange is that 6 Rest API calls works fine and the json that we receive when using Arc is valid. I don't realy understand the error message when saying Requested format \u0022application/json\u0022 is not supported Supported MIME types are \u0022application/ld+json\u0022 Here is the complete error message I get Screen shot of error message for ADF

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
11,625 questions
{count} votes

1 answer

Sort by: Most helpful
  1. ShaikMaheer-MSFT 38,546 Reputation points Microsoft Employee Moderator
    2023-02-10T11:26:17.9066667+00:00

    Hi Tony Johansson,

    Thank you for posting query in Microsoft Q&A Platform. Thanks for sharing screenshots. From screenshots its clear that the response in JSON LD type (JSON linked data). Hence from ADF when you are making API call its throwing error.

    User's image

    To avoid this error use Content-Type header value as application/ld+json.

    Hopefully that should solve your problem for failed API calls from ADF. Kindly let me know how it goes.

    ---------------

    Please consider hitting Accept Answer button. Accepted answers help community as well.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.