99
1010namespace MADE . App . Networking . Requests . Json
1111{
12- #if WINDOWS_UWP
13- using System ;
14- using System . Collections . Generic ;
15- using System . Threading ;
16- using System . Threading . Tasks ;
17-
18- using Windows . Storage . Streams ;
19- using Windows . Web . Http ;
20-
21- using Newtonsoft . Json ;
22-
23- #else
2412 using System ;
2513 using System . Collections . Generic ;
2614 using System . Net . Http ;
@@ -30,8 +18,6 @@ namespace MADE.App.Networking.Requests.Json
3018
3119 using Newtonsoft . Json ;
3220
33- #endif
34-
3521 /// <summary>
3622 /// Defines a network request for a POST call with a JSON response.
3723 /// </summary>
@@ -152,17 +138,6 @@ private async Task<string> GetJsonResponse(CancellationTokenSource cts = null)
152138
153139 Uri uri = new Uri ( this . Url ) ;
154140
155- #if WINDOWS_UWP
156-
157- var request = new HttpRequestMessage ( HttpMethod . Post , uri )
158- {
159- Content =
160- new HttpStringContent (
161- this . Data ,
162- UnicodeEncoding . Utf8 ,
163- "application/json" )
164- } ;
165- #else
166141 HttpRequestMessage request =
167142 new HttpRequestMessage ( HttpMethod . Post , uri )
168143 {
@@ -171,7 +146,6 @@ private async Task<string> GetJsonResponse(CancellationTokenSource cts = null)
171146 Encoding . UTF8 ,
172147 "application/json" )
173148 } ;
174- #endif
175149
176150 if ( this . Headers != null )
177151 {
@@ -181,15 +155,6 @@ private async Task<string> GetJsonResponse(CancellationTokenSource cts = null)
181155 }
182156 }
183157
184- #if WINDOWS_UWP
185- HttpResponseMessage response = cts == null
186- ? await this . client . SendRequestAsync (
187- request ,
188- HttpCompletionOption . ResponseHeadersRead )
189- : await this . client . SendRequestAsync (
190- request ,
191- HttpCompletionOption . ResponseHeadersRead ) . AsTask ( cts . Token ) ;
192- #else
193158 HttpResponseMessage response = cts == null
194159 ? await this . client . SendAsync (
195160 request ,
@@ -198,7 +163,6 @@ private async Task<string> GetJsonResponse(CancellationTokenSource cts = null)
198163 request ,
199164 HttpCompletionOption . ResponseHeadersRead ,
200165 cts . Token ) ;
201- #endif
202166
203167 response . EnsureSuccessStatusCode ( ) ;
204168
0 commit comments