class Playwright::Page

def expect_request(urlOrPredicate, timeout: nil, &block)

```
second_request = second.value
page.get_by_text("trigger request").click()
with page.expect_request(lambda request: request.url == "http://example.com" and request.method == "get") as second:
# or with a lambda

first_request = first.value
page.get_by_text("trigger request").click()
with page.expect_request("http://example.com/resource") as first:
```python sync

**Usage**

Waits for the matching request and returns it. See [waiting for event](../events.md#waiting-for-event) for more details about events.
def expect_request(urlOrPredicate, timeout: nil, &block)
  wrap_impl(@impl.expect_request(unwrap_impl(urlOrPredicate), timeout: unwrap_impl(timeout), &wrap_block_call(block)))
end