You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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
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
The text was updated successfully, but these errors were encountered: