@@ -127,11 +127,9 @@ public async Task<LoginUrlResponse> GetLoginUrlAsync(IExecutionContext ctx, IGam
127127 fullUrl += $ "?platform={ platform } ";
128128 }
129129
130- using var response = await _httpClient . GetAsync ( fullUrl ) ;
131-
132130 _logger . LogDebug ( "Calling Walmart ICS to retrieve login URL." ) ;
133- _logger . LogDebug ( $ "Request url: { fullUrl } " ) ;
134- _logger . LogDebug ( $ "Response status code: { response . StatusCode } " ) ;
131+
132+ using var response = await _httpClient . GetAsync ( fullUrl ) ;
135133
136134 if ( ! response . IsSuccessStatusCode )
137135 {
@@ -179,11 +177,9 @@ public async Task<AccountDetailsResponse> GetAccountDetailsAsync(IExecutionConte
179177 var fullUrl = string . Format ( ICS_GET_ACCOUNT_DETAILS_URL , icsHostname , isSandbox ? ICS_SANDBOX_URL_FRAGMENT : string . Empty , titleId ) ;
180178 _httpClient . DefaultRequestHeaders . Add ( WalmartAuthService . LCID_HEADER , lcid ) ;
181179
182- using var response = await _httpClient . GetAsync ( fullUrl ) ;
183-
184180 _logger . LogDebug ( "Calling Walmart ICS to get account details." ) ;
185- _logger . LogDebug ( $ "Request url: { fullUrl } " ) ;
186- _logger . LogDebug ( $ "Response status code: { response . StatusCode } " ) ;
181+
182+ using var response = await _httpClient . GetAsync ( fullUrl ) ;
187183
188184 if ( ! response . IsSuccessStatusCode )
189185 {
@@ -253,10 +249,9 @@ public async Task<LinkAccountResponse> LinkAccountAsync(IExecutionContext ctx, I
253249 var requestContent = new StringContent ( JsonSerializer . Serialize ( linkRequest , _jsonOptions ) , Encoding . UTF8 ,
254250 "application/json" ) ;
255251
256- using var response = await _httpClient . PostAsync ( fullUrl , requestContent ) ;
257252 _logger . LogDebug ( "Calling Walmart ICS to link account." ) ;
258- _logger . LogDebug ( $ "Request url: { fullUrl } " ) ;
259- _logger . LogDebug ( $ "Response status code: { response . StatusCode } " ) ;
253+
254+ using var response = await _httpClient . PostAsync ( fullUrl , requestContent ) ;
260255
261256 if ( ! response . IsSuccessStatusCode )
262257 {
@@ -316,11 +311,9 @@ public async Task<UnlinkAccountResponse> UnlinkAccountAsync(IExecutionContext ct
316311 var fullUrl = string . Format ( ICS_UNLINK_ACCOUNT_URL , icsHostname , isSandbox ? ICS_SANDBOX_URL_FRAGMENT : string . Empty , titleId ) ;
317312 _httpClient . DefaultRequestHeaders . Add ( WalmartAuthService . LCID_HEADER , lcid ) ;
318313
319- using var response = await _httpClient . DeleteAsync ( fullUrl ) ;
320-
321314 _logger . LogDebug ( "Calling Walmart ICS to unlink account." ) ;
322- _logger . LogDebug ( $ "Request url: { fullUrl } " ) ;
323- _logger . LogDebug ( $ "Response status code: { response . StatusCode } " ) ;
315+
316+ using var response = await _httpClient . DeleteAsync ( fullUrl ) ;
324317
325318 if ( ! response . IsSuccessStatusCode )
326319 {
@@ -381,11 +374,10 @@ public async Task<PlaceOrderResponse> PlaceOrderAsync(IExecutionContext ctx, IGa
381374
382375 var requestContent = new StringContent ( JsonSerializer . Serialize ( postPlaceOrderRequest , _jsonOptions ) , Encoding . UTF8 ,
383376 "application/json" ) ;
384- using var response = await _httpClient . PostAsync ( fullUrl , requestContent ) ;
385-
377+
386378 _logger . LogDebug ( "Calling Walmart ICS to place order." ) ;
387- _logger . LogDebug ( $ "Request url: { fullUrl } " ) ;
388- _logger . LogDebug ( $ "Response status code: { response . StatusCode } " ) ;
379+
380+ using var response = await _httpClient . PostAsync ( fullUrl , requestContent ) ;
389381
390382 if ( ! response . IsSuccessStatusCode )
391383 {
@@ -460,11 +452,10 @@ public async Task<PrepareOrderResponse> PrepareOrderAsync(IExecutionContext ctx,
460452 } ;
461453
462454 var requestContent = new StringContent ( JsonSerializer . Serialize ( request , _jsonOptions ) , Encoding . UTF8 , "application/json" ) ;
463- using var response = await _httpClient . PostAsync ( fullUrl , requestContent ) ;
464-
455+
465456 _logger . LogDebug ( "Calling Walmart ICS to prepare order." ) ;
466- _logger . LogDebug ( $ "Request url: { fullUrl } " ) ;
467- _logger . LogDebug ( $ "Response status code: { response . StatusCode } " ) ;
457+
458+ using var response = await _httpClient . PostAsync ( fullUrl , requestContent ) ;
468459
469460 if ( ! response . IsSuccessStatusCode )
470461 {
@@ -523,11 +514,10 @@ public async Task<PrepareOrderResponse> SetShippingAddressAsync(IExecutionContex
523514 } ;
524515
525516 var requestContent = new StringContent ( JsonSerializer . Serialize ( request , _jsonOptions ) , Encoding . UTF8 , "application/json" ) ;
526- using var response = await _httpClient . PostAsync ( fullUrl , requestContent ) ;
527-
517+
528518 _logger . LogDebug ( "Calling Walmart ICS to set shipping address." ) ;
529- _logger . LogDebug ( $ "Request url: { fullUrl } " ) ;
530- _logger . LogDebug ( $ "Response status code: { response . StatusCode } " ) ;
519+
520+ using var response = await _httpClient . PostAsync ( fullUrl , requestContent ) ;
531521
532522 if ( ! response . IsSuccessStatusCode )
533523 {
0 commit comments