📄 playwright-python/dotnet/docs/api/class-apiresponseassertions

File: class-apiresponseassertions.md | Updated: 11/18/2025

Source: https://playwright.dev/dotnet/docs/api/class-apiresponseassertions

Skip to main content

On this page

The APIResponseAssertions class provides assertion methods that can be used to make assertions about the APIResponse in the tests.


Methods


ToBeOKAsync

Added in: v1.18 apiResponseAssertions.ToBeOKAsync

Ensures the response status code is within 200..299 range.

Usage

Returns


Properties


Not

Added in: v1.20 apiResponseAssertions.Not

Makes the assertion check for the opposite condition. For example, this code tests that the response status is not successful:

Usage

Expect(Response).Not

Type