ADF - Web/Rest API request content-Type issue

Bhanuprasad 121 Reputation points
2021-03-12T03:52:54.317+00:00

Currently working on GET request in Azure Data Factory pipeline. The request works perfectly fine in Postman and CURL, but when tried in ADF it is not successful

Passing the Bearer token with Oauth
76979-image.png

When tried the same in ADF, getting the following error

Web activity
77032-image.png

Error: Details { "errors" : [ { "message" : "Content type '' not supported", "type" : "HttpMediaTypeNotSupportedError" } ] }

I have tried with Rest API and HTTP connector as well, getting similar error. Please advise if there any limitation on Content-Type and/or how we can address this issue.

Added:
I have tried different options as well but no success
76820-image.png

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

Accepted answer
  1. Bhanuprasad 121 Reputation points
    2021-04-08T02:09:54.267+00:00

    Thank you @Saurabh Sharma
    Symptom:
    Web Activity and REST connector have error in GET request.
    Error: Details { 'errors' : [ { 'message' : 'Content type '' not supported', 'type' : 'HttpMediaTypeNotSupportedError' } ] }

    Cause:
    ADF drops the Content-type header from a GET request if ‘request body’ is not specified, so per REST semantics, it should not have Content-type header enforced in a REST API because Content-Type entity-header field indicates the media type of the entity-body sent to the recipient

    Resolution:
    Change the receiving API setting content-type as optional

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. MadhaviB 76 Reputation points
    2021-03-14T06:01:43.653+00:00

    If auth works , then the next web activity for actual API (which uses the Bearer token) should be something like this. Hope it resolves your issue.

    @markus.bohland@hotmail.de ('Bearer ',activity('AuthToken').output.access_token) [Authorization expression]

    77500-image.png