@@ -23,8 +23,8 @@ public async Task<HttpResponse> GetDeviceInfoAsync(string registrationId)
2323 throw new ArgumentNullException ( registrationId ) ;
2424
2525 var url = BASE_URL + "/v3/devices/" + registrationId ;
26- HttpResponseMessage msg = await JPushClient . HttpClient . GetAsync ( url ) ;
27- var content = await msg . Content . ReadAsStringAsync ( ) ;
26+ HttpResponseMessage msg = await JPushClient . HttpClient . GetAsync ( url ) . ConfigureAwait ( false ) ;
27+ var content = await msg . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
2828 return new HttpResponse ( msg . StatusCode , msg . Headers , content ) ;
2929 }
3030
@@ -54,8 +54,8 @@ public async Task<HttpResponse> UpdateDeviceInfoAsync(string registrationId, str
5454
5555 var url = BASE_URL + "/v3/devices/" + registrationId ;
5656 HttpContent requestContent = new StringContent ( json , Encoding . UTF8 ) ;
57- HttpResponseMessage msg = await JPushClient . HttpClient . PostAsync ( url , requestContent ) ;
58- string responseContent = await msg . Content . ReadAsStringAsync ( ) ;
57+ HttpResponseMessage msg = await JPushClient . HttpClient . PostAsync ( url , requestContent ) . ConfigureAwait ( false ) ;
58+ string responseContent = await msg . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
5959 return new HttpResponse ( msg . StatusCode , msg . Headers , responseContent ) ;
6060 }
6161
@@ -75,8 +75,8 @@ public async Task<HttpResponse> GetDevicesByAliasAsync(string alias, string plat
7575 if ( ! string . IsNullOrEmpty ( platform ) )
7676 url += "?platform=" + platform ;
7777
78- HttpResponseMessage msg = await JPushClient . HttpClient . GetAsync ( url ) ;
79- string responseConetent = await msg . Content . ReadAsStringAsync ( ) ;
78+ HttpResponseMessage msg = await JPushClient . HttpClient . GetAsync ( url ) . ConfigureAwait ( false ) ;
79+ string responseConetent = await msg . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
8080 return new HttpResponse ( msg . StatusCode , msg . Headers , responseConetent ) ;
8181 }
8282
@@ -96,7 +96,7 @@ public async Task<HttpResponse> DeleteAliasAsync(string alias, string platform)
9696 if ( ! string . IsNullOrEmpty ( platform ) )
9797 url += "?platform=" + platform ;
9898
99- HttpResponseMessage msg = await JPushClient . HttpClient . DeleteAsync ( url ) ;
99+ HttpResponseMessage msg = await JPushClient . HttpClient . DeleteAsync ( url ) . ConfigureAwait ( false ) ;
100100 return new HttpResponse ( msg . StatusCode , msg . Headers , "" ) ;
101101 }
102102
@@ -108,8 +108,8 @@ public async Task<HttpResponse> DeleteAliasAsync(string alias, string platform)
108108 public async Task < HttpResponse > GetTagsAsync ( )
109109 {
110110 var url = BASE_URL + "/v3/tags/" ;
111- HttpResponseMessage msg = await JPushClient . HttpClient . GetAsync ( url ) ;
112- string responseContent = await msg . Content . ReadAsStringAsync ( ) ;
111+ HttpResponseMessage msg = await JPushClient . HttpClient . GetAsync ( url ) . ConfigureAwait ( false ) ;
112+ string responseContent = await msg . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
113113 return new HttpResponse ( msg . StatusCode , msg . Headers , responseContent ) ;
114114 }
115115
@@ -127,8 +127,8 @@ public async Task<HttpResponse> IsDeviceInTagAsync(string registrationId, string
127127 throw new ArgumentNullException ( nameof ( tag ) ) ;
128128
129129 var url = BASE_URL + "/v3/tags/" + tag + "/registration_ids/" + registrationId ;
130- HttpResponseMessage msg = await JPushClient . HttpClient . GetAsync ( url ) ;
131- string responseContent = await msg . Content . ReadAsStringAsync ( ) ;
130+ HttpResponseMessage msg = await JPushClient . HttpClient . GetAsync ( url ) . ConfigureAwait ( false ) ;
131+ string responseContent = await msg . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
132132 return new HttpResponse ( msg . StatusCode , msg . Headers , responseContent ) ;
133133 }
134134
@@ -154,7 +154,7 @@ public async Task<HttpResponse> AddDevicesToTagAsync(string tag, List<string> re
154154 } ;
155155
156156 var requestContent = new StringContent ( jObj . ToString ( ) , Encoding . UTF8 ) ;
157- HttpResponseMessage msg = await JPushClient . HttpClient . PostAsync ( url , requestContent ) ;
157+ HttpResponseMessage msg = await JPushClient . HttpClient . PostAsync ( url , requestContent ) . ConfigureAwait ( false ) ;
158158 return new HttpResponse ( msg . StatusCode , msg . Headers , "" ) ;
159159 }
160160
@@ -183,7 +183,7 @@ public async Task<HttpResponse> RemoveDevicesFromTagAsync(string tag, List<strin
183183 } ;
184184
185185 var requestContent = new StringContent ( jObj . ToString ( ) , Encoding . UTF8 ) ;
186- HttpResponseMessage msg = await JPushClient . HttpClient . PostAsync ( url , requestContent ) ;
186+ HttpResponseMessage msg = await JPushClient . HttpClient . PostAsync ( url , requestContent ) . ConfigureAwait ( false ) ;
187187 return new HttpResponse ( msg . StatusCode , msg . Headers , "" ) ;
188188 }
189189
@@ -202,7 +202,7 @@ public async Task<HttpResponse> DeleteTagAsync(string tag, string platform)
202202 if ( ! string . IsNullOrEmpty ( platform ) )
203203 url += "?platform=" + platform ;
204204
205- HttpResponseMessage msg = await JPushClient . HttpClient . DeleteAsync ( url ) ;
205+ HttpResponseMessage msg = await JPushClient . HttpClient . DeleteAsync ( url ) . ConfigureAwait ( false ) ;
206206 return new HttpResponse ( msg . StatusCode , msg . Headers , "" ) ;
207207 }
208208
@@ -220,8 +220,8 @@ public async Task<HttpResponse> GetUserOnlineStatusAsync(List<string> registrati
220220
221221 var requestJson = JsonConvert . SerializeObject ( registrationIds ) ;
222222 HttpContent requestContent = new StringContent ( requestJson , Encoding . UTF8 ) ;
223- HttpResponseMessage msg = await JPushClient . HttpClient . PostAsync ( url , requestContent ) ;
224- string responseContent = await msg . Content . ReadAsStringAsync ( ) ;
223+ HttpResponseMessage msg = await JPushClient . HttpClient . PostAsync ( url , requestContent ) . ConfigureAwait ( false ) ;
224+ string responseContent = await msg . Content . ReadAsStringAsync ( ) . ConfigureAwait ( false ) ;
225225 return new HttpResponse ( msg . StatusCode , msg . Headers , responseContent ) ;
226226 }
227227 }
0 commit comments