-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[Question]: How to retrieve form data from Playwright Request object? #1064
Description
Your question
I am adding a custom route handler to a Playwright page and I am trying to inspect the request passed into the handler. For context here is a following code snippet:
def handler(route: Route, request: Request):
# Do things with `request`
...
await page.route('**/*', handler=handler)For POST/PUT requests with a Content-Type of application/json, I have been able to successfully inspect the payload by using request.post_data_buffer. However, when the Content-Type is multipart/form-data, I have not been able locate where I can get the form data. All of the post_data, post_data_buffer, and post_data_json properties have a value of None, and I couldn't see anything else in the documentation which could contain the form_data.
I added a similar question to the generic playwright GitHub here
Could this also be a bug? I was not sure which is why I hesitated to open this as a bug