You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: aspnetcore/blazor/call-web-api.md
+38-16Lines changed: 38 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -364,6 +364,27 @@ The solution includes a demonstration of obtaining weather data securely via an
364
364
365
365
:::moniker-end
366
366
367
+
## Disposal of `HttpRequestMessage`, `HttpResponseMessage`, and `HttpClient`
368
+
369
+
An<xref:System.Net.Http.HttpRequestMessage>withoutabodydoesn't require explicit disposal with a [`using` declaration (C# 8 or later)](/dotnet/csharp/language-reference/proposals/csharp-8.0/using) or a `using` block (earlier than C# 8), but we recommend disposing with every use for the following reasons:
***Never***disposeof<xref:System.Net.Http.HttpClient>instancescreatedbycalling<xref:System.Net.Http.IHttpClientFactory.CreateClient%2A>becausethey're managed by the framework.
@@ -797,7 +818,7 @@ As of C# 11 (.NET 7), you can compose a JSON string as a [raw string literal](/d
797
818
<xref:System.Net.Http.Json.HttpClientJsonExtensions.PatchAsJsonAsync%2A>returnsan <xref:System.Net.Http.HttpResponseMessage>. TodeserializetheJSONcontentfromtheresponsemessage, usethe<xref:System.Net.Http.Json.HttpContentJsonExtensions.ReadFromJsonAsync%2A>extensionmethod. ThefollowingexamplereadsJSONtodoitemdataasanarray. Anemptyarrayiscreatedifnoitemdataisreturnedbythemethod, so `content` isn't null after the statement executes:
Copy file name to clipboardExpand all lines: aspnetcore/blazor/security/webassembly/standalone-with-identity/account-confirmation-and-password-recovery.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -331,7 +331,7 @@ public async Task<bool> ForgotPasswordAsync(string email)
0 commit comments