File tree Expand file tree Collapse file tree
src/Libraries/SmartStore.Core Expand file tree Collapse file tree Original file line number Diff line number Diff line change 448448 <Compile Include =" Utilities\DateTimeConvert.cs" />
449449 <Compile Include =" Utilities\DictionaryConverter.cs" />
450450 <Compile Include =" Utilities\Inflector.cs" />
451- <Compile Include =" Utilities\JsonObject .cs" />
451+ <Compile Include =" Utilities\JsonExtensions .cs" />
452452 <Compile Include =" Utilities\Prettifier.cs" />
453453 <Compile Include =" Utilities\Range.cs" />
454454 <Compile Include =" Utilities\StringTokenizer.cs" />
Original file line number Diff line number Diff line change 1+ using System ;
2+ using System . Net ;
3+ using System . Threading . Tasks ;
4+ using Newtonsoft . Json ;
5+
6+
7+ ///////////////////////////////////////////////////////////////////////
8+ // Needs JSon.Net (Newtonsoft.Json.dll) from http://json.codeplex.com/
9+ //////////////////////////////////////////////////////////////////////
10+
11+ namespace SmartStore . Core . Utilities
12+ {
13+ public static class JsonExtensions
14+ {
15+ public static async Task < dynamic > GetDynamicJsonObject ( this Uri uri )
16+ {
17+ using ( WebClient wc = new WebClient ( ) )
18+ {
19+ wc . Encoding = System . Text . Encoding . UTF8 ;
20+ wc . Headers [ "User-Agent" ] = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR 2.0.50727; .NET4.0C; .NET4.0E)" ;
21+ var response = await wc . DownloadStringTaskAsync ( uri ) ;
22+ return JsonConvert . DeserializeObjectAsync ( response ) ;
23+ }
24+ }
25+ }
26+ }
27+
28+
29+
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments