Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Inconsistent Type Hint for data Parameter in post() Method of Playwright Python API #34184

Open
Giridharagopal opened this issue Jan 1, 2025 · 0 comments
Assignees
Labels

Comments

@Giridharagopal
Copy link

The post() method in the Playwright Python API documentation specifies the type for the data parameter as str | bytes | None. However, in practice, the data parameter is often passed as a dict, especially when sending JSON payloads.
def post(self,
url: str,
*,
params: dict[str, str | float | bool] | str | None = None,
headers: dict[str, str] | None = None,
data: str | bytes | None = None)

Proposed Fix:
Update the type hint for the data parameter in the documentation to include dict as an acceptable type:

python
Copy code
data: dict | str | bytes | None = None

@dgozman dgozman added the v1.50 label Jan 2, 2025
@dgozman dgozman changed the title Inconsistent Type Hint for data Parameter in post() Method of Playwright Python API docs: Inconsistent Type Hint for data Parameter in post() Method of Playwright Python API Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants