Skip to content

[Feature]: IAPIRequestContext.GetAsync should be cancellable #3218

@lonix1

Description

@lonix1

🚀 Feature Request

The API doesn't support CancellationToken anywhere. In issue #1652 it was explained that cancellation would be pointless in many UI-based cases.

However there are cases where it would be actually useful, and expected according to .NET standards.

For example: page.APIRequest.GetAsync. That initiates a network call and should definitely be cancellable.

Example

await page.APIRequest.GetAsync("https://www.example.com/foo", cancellationToken);

Motivation

A network call that cannot be cancelled is not standard .NET and surprising.

Notes

If the method uses HttpClient "under the hood", then one should simply provide it with the cancellation token. It probably that simple.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions