SSIS 网络 API 连接
SSIS Web API Connection
我正在做一个 ETL 过程,我需要通过 SSIS 提取网络 api (Konviva),我只尝试过 RestSharp (C#)。
RestSharp 但是我在安装他的时候出错了:
Could not install package 'RestSharp 106.10.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author"
我已经查看了Framework版本,是Framework 4.7
这就是我要使用的脚本:
var client = new RestClient("http://xxxxxxxxxx.com/action/api/course");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "password");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);```
您需要更改脚本任务正在使用的 .NET Framework 版本。双击任务,然后点击 Edit Script
。加载脚本编辑器后,右键单击 Solution Explorer
窗格中 Solution
下的 C# 文件,然后选择 Properties
。
然后将 Target framework:
值从 .NET Framework 4.5
更改为 .NET Framework 4.7
。
一旦你这样做,VS 应该告诉你它会关闭并在保存后重新打开脚本文件。重新加载脚本后,再次保存并关闭脚本编辑器。
我正在做一个 ETL 过程,我需要通过 SSIS 提取网络 api (Konviva),我只尝试过 RestSharp (C#)。
RestSharp 但是我在安装他的时候出错了:
Could not install package 'RestSharp 106.10.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author"
我已经查看了Framework版本,是Framework 4.7
这就是我要使用的脚本:
var client = new RestClient("http://xxxxxxxxxx.com/action/api/course");
client.Timeout = -1;
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "password");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);```
您需要更改脚本任务正在使用的 .NET Framework 版本。双击任务,然后点击 Edit Script
。加载脚本编辑器后,右键单击 Solution Explorer
窗格中 Solution
下的 C# 文件,然后选择 Properties
。
然后将 Target framework:
值从 .NET Framework 4.5
更改为 .NET Framework 4.7
。
一旦你这样做,VS 应该告诉你它会关闭并在保存后重新打开脚本文件。重新加载脚本后,再次保存并关闭脚本编辑器。