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

[Question]: How to retrieve form data from Playwright Request object? #1064

Closed
yannsartori opened this issue Dec 6, 2021 · 1 comment
Closed

Comments

@yannsartori
Copy link

yannsartori commented Dec 6, 2021

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

@yannsartori
Copy link
Author

The issue was I was using Chromium instead of Firefox:
microsoft/playwright#6479

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant