class Playwright::Route

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

```
page.route("**/*", handle)

route.fallback(headers=headers)
}
"bar": None # remove "bar" header
"foo": "foo-value", # set "foo" header
**request.headers,
headers = {
# override headers
def handle(route, request):
```python sync

route handler can modify url, method, headers and postData of the request.
One can also modify request while falling back to the subsequent handler, that way intermediate

```
page.route("**/*", handle_post)
page.route("**/*", handle_get)

# ...
# Handling POST only.
return
route.fallback()
if route.request.method != "POST":
def handle_post(route):
# Handle POST requests.

# ...
# Handling GET only.
return
route.fallback()
if route.request.method != "GET":
def handle_get(route):
# Handle GET requests.
```python sync

GET requests vs POST requests as in the example below.
handle different kinds of requests, for example API calls vs page resources or
Registering multiple routes is useful when you want separate handlers to

```
page.route("**/*", lambda route: route.fallback()) # Runs first.
page.route("**/*", lambda route: route.fallback()) # Runs second.
page.route("**/*", lambda route: route.abort()) # Runs last.
```python sync

**Usage**

in the end will be aborted by the first registered route.
request will be handled by the bottom-most handler first, then it'll fall back to the previous one and
That way the last registered route can always override all the previous ones. In the example below,
When several routes match the given pattern, they run in the order opposite to their registration.
def fallback(headers: nil, method: nil, postData: nil, url: nil)
  wrap_impl(@impl.fallback(headers: unwrap_impl(headers), method: unwrap_impl(method), postData: unwrap_impl(postData), url: unwrap_impl(url)))
end