See here: https://github.com/dotnet/runtime/blob/a8baca13ea08916e32b57413488a6cd0a20c6d13/src/libraries/Common/tests/System/Net/Http/Http2LoopbackConnection.cs#L973 This code should also validate that the client sent the CANCEL error code in the RST_STREAM frame. RFC reference: https://httpwg.org/specs/rfc7540.html#ErrorCodes