Answer the question
In order to leave comments, you need to log in
Why is there an error when parsing JSON?
When parsing such a response from the server
{"response":{"short_url":"https:\/\/vk.cc\/8CcI9Y"}}
public Dictionary<string, string> URLShorter(string URL)
{
HttpRequest URLShorter = new HttpRequest();
URLShorter.AddUrlParam("url", URL);
URLShorter.AddUrlParam("access_token", _Token);
URLShorter.AddUrlParam("version", "5.92");
string Result = URLShorter.Get(__VKAPIURL + "utils.checkLink").ToString();
Dictionary<string, string> Dist = JsonConvert.DeserializeObject<Dictionary<string, string>>(Result);
return Dist;
}
Answer the question
In order to leave comments, you need to log in
Everything is fine with json:
The problem is either in Newtonsoft.Json.dll itself or the answer is not the same as you show.
1) there should be a more accurate description of the error
2) mb is neededDictionary<string, Dictionary<string, string>>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question