Author Topic: [C#] JSON to ExpandoObject from Web URL  (Read 796 times)

0 Members and 1 Guest are viewing this topic.

Offline xor

  • Peasant
  • *
  • Posts: 59
  • Cookies: 32
    • View Profile
[C#] JSON to ExpandoObject from Web URL
« on: May 19, 2015, 02:14:40 am »

Code: [Select]
        public static dynamic GetJson(string url)
        {
            dynamic s;
            using (var client = new WebClient())
            {
                var json = client.DownloadString(url);
                s = JsonConvert.DeserializeObject<ExpandoObject>(json);
            }


            return s;
        }

Offline Xires

  • Noob Eater
  • Administrator
  • Knight
  • *
  • Posts: 379
  • Cookies: 149
    • View Profile
    • Feed The Trolls - Xires
Re: [C#] JSON to ExpandoObject from Web URL
« Reply #1 on: May 21, 2015, 12:04:05 pm »
Linq is thoroughly confused by embedding this into statements.  It's rather humorous.  Excellent submission, though.  Thanks much.  It's sad to see your nick with so few cookies so have a couple extra. ;-P
-Xires