无法使用RestSharp和GoCardless设置MIME类型

Cannot set MIME type using RestSharp and GoCardless

Using C#, .Net 4,5, RestSharp v4.0.3

Attempting to create an api_key in GoCardless

I create a RestClient like this:

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");

When I post to GoCardless I get the error

{"error":{"message":"'Content-Type' header must be application/json or application/vnd.api+json ......

After a lot of fruitless searching I gave up and used the solutions in older StackOverflow postings. Such as

// Create the Json for the new object
StringBuilder requestJson = new StringBuilder();
var requestObject = new { api_keys = new { name = name, links = new { role = role } } };
(new JavaScriptSerializer()).Serialize(requestObject, requestJson);
...
// Set up the RestSharp request
request.Parameters.Clear();
request.AddParameter("application/json", requestJson, ParameterType.RequestBody);

I can see why this works - and even perhaps the intention of RestSharp doing it this way.