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

alexis 101 Reputation points
2022-10-26T13:44:39.433+00:00

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

Error code
23360
Details
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.
10,814 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Michael Taylor 54,806 Reputation points
    2022-10-26T14:20:33.397+00:00

    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 101 Reputation points
    2022-10-26T14:47:40.75+00:00

    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:
    254421-image.png

    254343-image.png


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.