AspNetCore.Docs/aspnetcore/includes/reset.md

11 lines
640 B
Markdown
Raw Normal View History

---
2021-05-02 07:03:18 +08:00
no-loc: [Kestrel, appsettings.json, "ASP.NET Core Identity", cookie, Cookie, Blazor, "Blazor Server", "Blazor WebAssembly", "Identity", "Let's Encrypt", Razor, SignalR]
---
Reset allows for the server to reset a HTTP/2 request with a specified error code. A reset request is considered aborted.
```csharp
var resetFeature = httpContext.Features.Get<IHttpResetFeature>();
resetFeature.Reset(errorCode: 2);
```
`Reset` in the preceding code example specifies the `INTERNAL_ERROR` error code. For more information about HTTP/2 error codes, visit the [HTTP/2 specification error code section](https://tools.ietf.org/html/rfc7540#page-50).