class Playwright::Route

allows to handle the route.
Whenever a network route is set up with [‘method: Page.route`] or [`method: BrowserContext.route`], the `Route` object

def abort(errorCode: nil)

Aborts the route's request.
def abort(errorCode: nil)
  wrap_impl(@impl.abort(errorCode: unwrap_impl(errorCode)))
end

def continue(headers: nil, method: nil, postData: nil, url: nil)

```
page.route("**/*", handle)
}
route.continue_(headers=headers)
}
"origin": None # remove "origin" header
"foo": "bar" # set "foo" header
**request.headers,
headers = {
# override headers
def handle(route, request):
```python sync

Continues route's request with optional overrides.
def continue(headers: nil, method: nil, postData: nil, url: nil)
  wrap_impl(@impl.continue(headers: unwrap_impl(headers), method: unwrap_impl(method), postData: unwrap_impl(postData), url: unwrap_impl(url)))
end

def event_emitter_proxy

def event_emitter_proxy
_emitter_proxy ||= EventEmitterProxy.new(self, @impl)

def fulfill(

```
page.route("**/xhr_endpoint", lambda route: route.fulfill(path="mock_data.json"))
```python sync

An example of serving static file:

```
body="not found!"))
content_type="text/plain",
status=404,
page.route("**/*", lambda route: route.fulfill(
```python sync

An example of fulfilling all requests with 404 responses:

Fulfills route's request with given response.
def fulfill(
      body: nil,
      contentType: nil,
      headers: nil,
      path: nil,
      status: nil)
  wrap_impl(@impl.fulfill(body: unwrap_impl(body), contentType: unwrap_impl(contentType), headers: unwrap_impl(headers), path: unwrap_impl(path), status: unwrap_impl(status)))
end

def off(event, callback)

@nodoc
-- inherited from EventEmitter --
def off(event, callback)
  event_emitter_proxy.off(event, callback)
end

def on(event, callback)

@nodoc
-- inherited from EventEmitter --
def on(event, callback)
  event_emitter_proxy.on(event, callback)
end

def once(event, callback)

@nodoc
-- inherited from EventEmitter --
def once(event, callback)
  event_emitter_proxy.once(event, callback)
end

def request

A request to be routed.
def request
  wrap_impl(@impl.request)
end