MCPcopy Index your code
hub / github.com/microsoft/playwright-python / set_redirect

Method set_redirect

tests/server.py:269–275  ·  view source on GitHub ↗
(self, from_: str, to: str)

Source from the content-addressed store, hash-verified

267 self.gzip_routes.add(path)
268
269 def set_redirect(self, from_: str, to: str) -> None:
270 def handle_redirect(request: http.Request) -> None:
271 request.setResponseCode(HTTPStatus.FOUND)
272 request.setHeader("location", to)
273 request.finish()
274
275 self.set_route(from_, handle_redirect)
276
277 def send_on_web_socket_connection(self, data: bytes) -> None:
278 self.once_web_socket_connection(lambda ws: ws.sendMessage(data))

Calls 1

set_routeMethod · 0.95