MCPcopy Create free account
hub / github.com/microsoft/playwright-python / support_post_data

Function support_post_data

tests/async/test_fetch_browser_context.py:266–277  ·  view source on GitHub ↗
(fetch_data: Any, request_post_data: Any)

Source from the content-addressed store, hash-verified

264 context: BrowserContext, method: str, server: Server
265) -> None:
266 async def support_post_data(fetch_data: Any, request_post_data: Any) -> None:
267 [request, response] = await asyncio.gather(
268 server.wait_for_request("/simple.json"),
269 getattr(context.request, method)(
270 server.PREFIX + "/simple.json", data=fetch_data
271 ),
272 )
273 assert request.method.decode() == method.upper()
274 assert request.post_body == request_post_data
275 assert response.status == 200
276 assert response.url == server.PREFIX + "/simple.json"
277 assert request.getHeader("Content-Length") == str(len(must(request.post_body)))
278
279 await support_post_data("My request", "My request".encode())
280 await support_post_data(b"My request", "My request".encode())

Callers 1

Calls 2

mustFunction · 0.90
wait_for_requestMethod · 0.80

Tested by

no test coverage detected