I am writing a seemingly simple application to interrogate variables in deployments.
I have several test queries on user/teams etc and all work fine.
However when I try to look at variables using the following code it returns a cast error.
Unable to cast object of type ‘System.String’ to type ‘System.Collections.Generic.IDictionary`2[System.String,System.Object]’.
client.Authenticator = new RestSharp.Authenticators.SimpleAuthenticator(“username”, Username, “password”, Password);
var request = new RestRequest(“api/variables/names”, Method.GET);
request.RequestFormat = DataFormat.Json;
request.AddHeader(“X-Octopus-ApiKey”, “myapikey”);
var response = client.Execute(request);
JsonDeserializer deserial = new JsonDeserializer();
var JSONObj = deserial.Deserialize<List>(response);
For all other queries the response.content contains a string starting and ending with {\r\n … \r\n}
However, this query’s response.content starts and ends with [\r\n…\r\n]
Am I doing something wrong or is there a problem with the API call and its resolution to JSON format?
Thanks