I use RestSharp to send a request to the Yandex API, but for some reason the result variable is not populated.
JSON is clearly visible in the response variable.
public Result GetLangByString(string str) { var request = new RestRequest("/api/v1.5/tr.json/detect", Method.POST); request.Credentials = CredentialCache.DefaultCredentials; request.AddParameter("key", _key); request.AddParameter("text", str); IRestResponse response = _restClient.Execute(request); RestSharp.Deserializers.JsonDeserializer deserializer = new RestSharp.Deserializers.JsonDeserializer(); var result = deserializer.Deserialize<Result>(response); return result; } public class Result { public int code; public string lang; } If the fields are replaced with properties, then everything works. Are these any particulars or is it accepted?