Rick Freeman

Rick Freeman

  • NA
  • 30
  • 8.7k

Json Serialize / Deserialization

Oct 22 2015 7:23 PM
Hello,
 
I'm trying to parse this json data, I'm getting this error:
Unexpected character encountered while parsing value: T. Path '', line 0, position 0
 
 string result = service.Response.ToString();
 
The result data is shown in attached file. 
 string deserializeObj = JsonConvert.DeserializeObject(result).ToString(); // error
  
            JObject j = JObject.Parse(deserializeObj);
 
same error if I try: JObject j = JObject.Parse(result);
 

            JArray data = (JArray)j["users"];

            var query = new List<Followers>();

            query = (from item in data

                     select new Followers
                     {

                         screenName = item["screen_name"].ToString().Replace("\"", ""),
                         profileImage = item["profile_image_url"].ToString().Replace("\"", ""),
                   userID = long.Parse(item["id"].ToString().Replace("\"", ""))

                      
                     }).ToList();

            return query;

Attachment: response.zip

Answers (3)