Skip to content

[Feature] Make page.request.fetch work as described in Node.js docs #1312

@sla-te

Description

@sla-te

I have tried to use this code translated to python https://playwright.dev/docs/network#modify-responses

r = await page.request.fetch(route.request)
await route.fulfill(
	status=r.status,
	body=await r.body(),
	headers=r.headers,
	content_type=r.headers['content-type'],
	response=r,
)

and it throws AssertionError: First argument must be either URL string or Request, anything Iam doing wrong?

NOTE: If i remove the assertion, the API will return 400 bad request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions