Character set error when trying to import from web API: ContentType is invalid

alexis 96 Reputation points

I'm getting following error when I try to do a request with Azure Data Factory V2:

Error code
Fail to read from REST resource.
The character set provided in ContentType is invalid. Cannot read content as string using an invalid character set.
'"utf-8"' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.
Parameter name: name
Activity ID: 085755a2-f720-4b53-9b20-3b9c99b7dddf

When I do I http request from the their homepage I see that

content-type: application/json; charset=utf-8

does not have any quotation mark. I think it expects the UTF-8 to be without quotation marks.

Is there any way to get around this?

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
8,488 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 41,811 Reputation points

    Content-Type is a standard HTTP header and is already a string (because headers are key-value pairs). There are no double quotes in them. I think the error is misleading you. Unless you're trying to parse the response by hand the Content-Type is being read properly and it is just how the error message is being shown. ADF supports JSON as it is the most common API format.

    Can you provide us information on how you're consuming the API call including any settings you're using.

    0 comments No comments

  2. alexis 96 Reputation points

    hi @Michael Taylor , I have put my credentials in the linked service and then I go to my pipeline and try to preview the data and get the utf-8 issue: