【发布时间】:2015-04-27 18:10:51
【问题描述】:
使用 C#、.Net 4,5、RestSharp v4.0.3
尝试在 GoCardless 中创建 api_key
我这样创建一个 RestClient:
var client = new RestClient();
client.BaseUrl = SandboxBaseUrl;
client.Authenticator = new HttpBasicAuthenticator(apiKeyId, apiKey);
client.AddDefaultHeader("GoCardless-Version", Properties.Settings.Default.GoCardlessVersion);
client.AddDefaultHeader("Accept", "application/json");
client.AddDefaultHeader("content-type", "application/json");
request.AddHeader("content-type", "application/json");
当我发布到 GoCardless 时出现错误
{"error":{"message":"'Content-Type' header must be application/json or application/vnd.api+json ......
【问题讨论】:
-
那是 2012 年更早版本的 RestSharp
标签: c# mime restsharp gocardless